Пример #1
0
GLdouble getVectorsAngle(PVector Vector1, PVector Vector2) {
    Vector V1, V2;
    
    V1 = getNormalizedVector(Vector1);
    V2 = getNormalizedVector(Vector2);

    return (acos(getVectorsDot(&V1, &V2)));
}
void btKinematicCharacterController::setWalkDirection
(
const btVector3& walkDirection
)
{
	m_useWalkDirection = true;
	m_walkDirection = walkDirection;
	m_normalizedDirection = getNormalizedVector(m_walkDirection);
}
Пример #3
0
Vector getVectorsNormale3(PVector Vector1, PVector Vector2, PVector Vector3) {
    Vector V1, V2, V3, MyVector;
    
    V1 = subVectors(Vector1, Vector2);
    V2 = subVectors(Vector2, Vector3);
    V3 = getVectorsNormale2(&V1, &V2);
    MyVector = getNormalizedVector(&V3);
    
    return (MyVector);
}
void btKinematicCharacterController::setVelocityForTimeInterval
(
const btVector3& velocity,
btScalar timeInterval
)
{
//	printf("setVelocity!\n");
//	printf("  interval: %f\n", timeInterval);
//	printf("  velocity: (%f, %f, %f)\n",
//		 velocity.x(), velocity.y(), velocity.z());

	m_useWalkDirection = false;
	m_walkDirection = velocity;
	m_normalizedDirection = getNormalizedVector(m_walkDirection);
	m_velocityTimeInterval += timeInterval;
}