void gep::HavokCharacterRigidBody::setLinearVelocity(const vec3& newVelocity, float deltaTime) { GEP_ASSERT(deltaTime > 0.0f || !epsilonCompare(deltaTime, 0.0f), "The delta time must be greater than zero!"); hkVector4 linearVelocity; conversion::hk::to(newVelocity, linearVelocity); m_pHkCharacterRigidBody->setLinearVelocity(linearVelocity, deltaTime); }
void gep::FreeCameraHorizon::move(vec3 delta) { vec3 m_left = m_viewDir.cross(vec3(0,0,1)); float angle = abs(m_viewDir.dot(vec3(0,0,1))); if(epsilonCompare(angle, GetPi<float>::value()/2.0f)) m_left = vec3(0,1,0); m_position += m_viewDir * -delta.z + m_left * delta.x; }
void animation::animate() { if(!finished) { auto newPos = position; newPos += increment * direction; position = newPos; shape.setPosition(position); if(epsilonCompare(end, position)) { finished = true; } } }