void Transform::accept(log::LogVisitor& visitor) const { visitor << "Transform"; if ( getName() != "" ) { visitor << " '" << getName() << "'"; } visitor << "\n{\n" << log::indent() << "transform =" << log::detailed(getTransform(), true) << "localToWorld =" << log::detailed(getLocalToWorld(), true) ; visitor.visitGroup(*this); visitor << log::unindent() << "}\n"; }
void Transform::transform(glm::vec3 & p3) const { glm::vec4 p4 = glm::vec4(p3, 1.0f); p4 = getLocalToWorld() * p4; // TODO cache matrix p3 = glm::vec3(p4.x, p4.y, p4.z); }