void Node::rotateBy(const Matrix3x3& rotation) { localTransform_.rotation *= rotation; invalidateWorldTransform(); // invalidateWorlTransform() should invalidate the world transform GRAPHICS_RUNTIME_ASSERT(worldTransformValid_ == false); }
void Node::transformBy(const Transform3& transform) { localTransform_ = ::transform(localTransform_, transform); invalidateWorldTransform(); // invalidateWorlTransform() should invalidate the world transform GRAPHICS_RUNTIME_ASSERT(worldTransformValid_ == false); }
void Node::translateBy(const Vector3& translation) { localTransform_.translation += translation; invalidateWorldTransform(); // invalidateWorlTransform() should invalidate the world transform GRAPHICS_RUNTIME_ASSERT(worldTransformValid_ == false); }
void Node::setLocalScale(float newScale) { m_local.scale = newScale; if (m_parent) m_parent->invalidateBounds(); invalidateWorldTransform(); }
void Node::setLocalRotation(const quat& newRotation) { m_local.rotation = newRotation; if (m_parent) m_parent->invalidateBounds(); invalidateWorldTransform(); }
void Node::setLocalPosition(const vec3& newPosition) { m_local.position = newPosition; if (m_parent) m_parent->invalidateBounds(); invalidateWorldTransform(); }
void Node::setLocalTransform(const Transform3& newTransform) { m_local = newTransform; if (m_parent) m_parent->invalidateBounds(); invalidateWorldTransform(); }
void Node::scaleBy(const float scaling) { GRAPHICS_RUNTIME_ASSERT(scaling > 0.0f); localTransform_.scaling *= scaling; invalidateWorldTransform(); // invalidateWorlTransform() should invalidate the world transform GRAPHICS_RUNTIME_ASSERT(worldTransformValid_ == false); }
void Node::setScalingLocked(const bool locked) { if (scalingLocked_ == locked) { // nothing to do return; } scalingLocked_ = locked; invalidateWorldTransform(); // invalidateWorlTransform() should invalidate the world transform GRAPHICS_RUNTIME_ASSERT(worldTransformValid_ == false); }
void Node::removeFromParent() { if (m_parent || m_graph) { if (m_parent) { auto& siblings = m_parent->m_children; siblings.erase(std::find(siblings.begin(), siblings.end(), this)); m_parent->invalidateBounds(); m_parent = nullptr; invalidateWorldTransform(); } else { auto& roots = m_graph->m_roots; roots.erase(std::find(roots.begin(), roots.end(), this)); } setGraph(nullptr); } }