void TerrainComponent::addPoint(int index, float x, float y) { Vector2f pos = Vector2f(x, y); this->chainVertices[index] = pos.getBox2d(); if(owner->hasComponent("wirechainRender")) ((WirechainRenderComponent*) owner->getComponent("wirechainRender"))->addPoint(index, pos.getSFMLPos()); }
void WirechainRenderComponent::addPoint(int index, float x, float y) { sf::Vector2f ownerPos = owner->getPosition().getSFMLPos(); Vector2f pos = Vector2f(x + ownerPos.x, y + ownerPos.y); this->renderVertices[index] = pos.getSFMLPos(); }