Ejemplo n.º 1
1
TEST_F(Vector2Test, creating_orthonormal_basis_with_zero_vector_asserts)
{
    Math::Vec2d empty_vector;
    EXPECT_DEATH(generate_orthonormal_basis(random_vector, empty_vector),
            "Can not make orthonormal basis from a zero vector");
    EXPECT_DEATH(generate_orthonormal_basis(empty_vector, random_vector),
            "Can not make orthonormal basis from a zero vector");
}
Ejemplo n.º 2
0
TEST_F(Vector2Test, orthonormal_basis_creates_perpendicular_vectors_of_length_1)
{
    if (random_vector != random_vector2) {
        generate_orthonormal_basis(random_vector, random_vector2);
        EXPECT_NEAR(0.0, dot_product(random_vector, random_vector2), PRECISION);
        EXPECT_NEAR(1.0, vector_length(random_vector), PRECISION);
        EXPECT_NEAR(1.0, vector_length(random_vector2), PRECISION);
    }
}
Ejemplo n.º 3
0
void CParticlesPlayer::MakeXFORM	(CObject* pObject, u16 bone_id, const Fvector& dir, const Fvector& offset, Fmatrix& result)
{
    generate_orthonormal_basis(dir,result);
    GetBonePos(pObject, bone_id, offset, result.c);
}
Ejemplo n.º 4
0
void CParticlesPlayer::StartParticles(const shared_str& ps_name, const Fvector& dir, u16 sender_id, int life_time, bool auto_stop)
{
    Fmatrix xform;
    generate_orthonormal_basis(dir,xform);
    StartParticles(ps_name,xform,sender_id,life_time,auto_stop);
}
Ejemplo n.º 5
0
TEST_F(Vector2Test, creating_orthonormal_basis_with_same_vector_asserts)
{
    EXPECT_DEATH(generate_orthonormal_basis(random_vector, random_vector),
            "Can not make orthonormal basis from equal vectors");
}