improved physics, added better caching
This commit is contained in:
97
engine/physics.cpp
Normal file
97
engine/physics.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
#include "physics.h"
|
||||
#include "cglm/mat4.h"
|
||||
#include "physics_gen.h"
|
||||
|
||||
void CPxCollider::Spawn( float fFriction )
|
||||
{
|
||||
|
||||
};
|
||||
void CPxCollider::Destroy()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
void CPxBallMesh::Spawn( float fFriction )
|
||||
{
|
||||
m_pCollider = px_ball(m_fRadius, {.friction = fFriction});
|
||||
};
|
||||
|
||||
void CPxBallMesh::Destroy()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
void CPxBoxMesh::Spawn( float fFriction )
|
||||
{
|
||||
m_pCollider = px_box(m_fRadius[0], m_fRadius[1], m_fRadius[2], {.friction = fFriction});
|
||||
};
|
||||
|
||||
void CPxBoxMesh::Destroy()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
void CPxTriangleMesh::Spawn( float fFriction )
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
void CPxTriangleMesh::Destroy()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
void CPxRigidBody::Spawn( CPxCollider *pCollider, px_matrix matrix, px_rigidbody_params params )
|
||||
{
|
||||
m_pRigidBody = px_rigidbody(px, pCollider->m_pCollider, matrix, params);
|
||||
};
|
||||
px_vec3 CPxRigidBody::GetPosition( void )
|
||||
{
|
||||
return px_getposition(px, m_pRigidBody);
|
||||
};
|
||||
px_matrix CPxRigidBody::GetMatrix ( void )
|
||||
{
|
||||
return px_getmatrix(px, m_pRigidBody);
|
||||
};
|
||||
|
||||
void CPxRigidBody::Destroy()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
void CPxStaticBody::Spawn( CPxCollider *pCollider, px_matrix matrix, px_rigidbody_params params )
|
||||
{
|
||||
px_staticbody(px, pCollider->m_pCollider, matrix);
|
||||
};
|
||||
px_vec3 CPxStaticBody::GetPosition( void )
|
||||
{
|
||||
return px_getposition(px, m_pCollider);
|
||||
};
|
||||
px_matrix CPxStaticBody::GetMatrix ( void )
|
||||
{
|
||||
return px_getmatrix(px, m_pCollider);
|
||||
};
|
||||
|
||||
void CPxStaticBody::Destroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
;
|
||||
void CPxFixedBody::Spawn( CPxCollider *pCollider, px_matrix matrix, px_rigidbody_params params )
|
||||
{
|
||||
px_fixedbody(px, pCollider->m_pCollider);
|
||||
};
|
||||
px_vec3 CPxFixedBody::GetPosition( void )
|
||||
{
|
||||
return px_getposition(px, m_pCollider);
|
||||
};
|
||||
px_matrix CPxFixedBody::GetMatrix ( void )
|
||||
{
|
||||
return px_getmatrix(px, m_pCollider);
|
||||
};
|
||||
|
||||
void CPxFixedBody::Destroy()
|
||||
{
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user