Add isRound flag

This commit is contained in:
ABelliqueux 2021-06-24 12:26:30 +02:00
parent 2ac1d3d912
commit 298d59626d
4 changed files with 89 additions and 87 deletions

View File

@ -52,6 +52,7 @@ typedef struct MESH {
SVECTOR rot;
short isRigidBody;
short isStaticBody;
short isRound;
short isPrism;
short isAnim;
short isActor;

View File

@ -25,8 +25,8 @@
#define PRIMBUFFLEN 4096 * sizeof(POLY_GT4) // Maximum number of POLY_GT3 primitives
// Fog
#define FOG_NEAR 1300
#define FOG_FAR 1600
#define FOG_NEAR 2300
#define FOG_FAR 2600
// Physics
#define GRAVITY 10

View File

@ -10005,6 +10005,7 @@ MESH level1_meshSphere_001 = {
0,
0,
0,
0,
&level1_modelSphere_001_body,
0,
&level1_nodegnd,

View File

@ -492,11 +492,11 @@ int main() {
if (col_sphere_act.vx && col_sphere_act.vz ) {
curLvl.propPtr->body->velocity.vx += curLvl.actorPtr->body->velocity.vx;
curLvl.propPtr->body->velocity.vz += curLvl.actorPtr->body->velocity.vz;
if ( curLvl.propPtr->body->velocity.vx ) {
if ( curLvl.propPtr->isRound && curLvl.propPtr->body->velocity.vx ) {
VECTOR L = angularMom( *curLvl.propPtr->body );
curLvl.propPtr->rot.vz -= L.vx;
}
if ( curLvl.propPtr->body->velocity.vz ) {
if ( curLvl.propPtr->isRound && curLvl.propPtr->body->velocity.vz ) {
VECTOR L = angularMom( *curLvl.propPtr->body );
curLvl.propPtr->rot.vx -= L.vz;
}