forked from bartvdbraak/blender
Code Cleanup: style
This commit is contained in:
parent
81b64e506f
commit
d09a8ea9e7
@ -112,9 +112,10 @@ void RB_dworld_remove_body(rbDynamicsWorld *world, rbRigidBody *body);
|
|||||||
|
|
||||||
/* Collision detection */
|
/* Collision detection */
|
||||||
|
|
||||||
void RB_world_convex_sweep_test(rbDynamicsWorld *world, rbRigidBody *object,
|
void RB_world_convex_sweep_test(
|
||||||
const float loc_start[3], const float loc_end[3],
|
rbDynamicsWorld *world, rbRigidBody *object,
|
||||||
float v_location[3], float v_hitpoint[3], float v_normal[3], int *r_hit);
|
const float loc_start[3], const float loc_end[3],
|
||||||
|
float v_location[3], float v_hitpoint[3], float v_normal[3], int *r_hit);
|
||||||
|
|
||||||
/* ............ */
|
/* ............ */
|
||||||
|
|
||||||
|
@ -265,7 +265,10 @@ void RB_dworld_remove_body(rbDynamicsWorld *world, rbRigidBody *object)
|
|||||||
|
|
||||||
/* Collision detection */
|
/* Collision detection */
|
||||||
|
|
||||||
void RB_world_convex_sweep_test(rbDynamicsWorld *world, rbRigidBody *object, const float loc_start[3], const float loc_end[3], float v_location[3], float v_hitpoint[3], float v_normal[3], int *r_hit)
|
void RB_world_convex_sweep_test(
|
||||||
|
rbDynamicsWorld *world, rbRigidBody *object,
|
||||||
|
const float loc_start[3], const float loc_end[3],
|
||||||
|
float v_location[3], float v_hitpoint[3], float v_normal[3], int *r_hit)
|
||||||
{
|
{
|
||||||
btRigidBody *body = object->body;
|
btRigidBody *body = object->body;
|
||||||
btCollisionShape *collisionShape = body->getCollisionShape();
|
btCollisionShape *collisionShape = body->getCollisionShape();
|
||||||
@ -285,14 +288,14 @@ void RB_world_convex_sweep_test(rbDynamicsWorld *world, rbRigidBody *object, con
|
|||||||
rayToTrans.setRotation(obRot);
|
rayToTrans.setRotation(obRot);
|
||||||
rayToTrans.setOrigin(btVector3(loc_end[0], loc_end[1], loc_end[2]));
|
rayToTrans.setOrigin(btVector3(loc_end[0], loc_end[1], loc_end[2]));
|
||||||
|
|
||||||
world->dynamicsWorld->convexSweepTest((btConvexShape*) collisionShape, rayFromTrans, rayToTrans, result, 0);
|
world->dynamicsWorld->convexSweepTest((btConvexShape *)collisionShape, rayFromTrans, rayToTrans, result, 0);
|
||||||
|
|
||||||
if (result.hasHit()) {
|
if (result.hasHit()) {
|
||||||
*r_hit = 1;
|
*r_hit = 1;
|
||||||
|
|
||||||
v_location[0] = result.m_convexFromWorld[0]+(result.m_convexToWorld[0]-result.m_convexFromWorld[0])*result.m_closestHitFraction;
|
v_location[0] = result.m_convexFromWorld[0] + (result.m_convexToWorld[0] - result.m_convexFromWorld[0]) * result.m_closestHitFraction;
|
||||||
v_location[1] = result.m_convexFromWorld[1]+(result.m_convexToWorld[1]-result.m_convexFromWorld[1])*result.m_closestHitFraction;
|
v_location[1] = result.m_convexFromWorld[1] + (result.m_convexToWorld[1] - result.m_convexFromWorld[1]) * result.m_closestHitFraction;
|
||||||
v_location[2] = result.m_convexFromWorld[2]+(result.m_convexToWorld[2]-result.m_convexFromWorld[2])*result.m_closestHitFraction;
|
v_location[2] = result.m_convexFromWorld[2] + (result.m_convexToWorld[2] - result.m_convexFromWorld[2]) * result.m_closestHitFraction;
|
||||||
|
|
||||||
v_hitpoint[0] = result.m_hitPointWorld[0];
|
v_hitpoint[0] = result.m_hitPointWorld[0];
|
||||||
v_hitpoint[1] = result.m_hitPointWorld[1];
|
v_hitpoint[1] = result.m_hitPointWorld[1];
|
||||||
@ -307,7 +310,7 @@ void RB_world_convex_sweep_test(rbDynamicsWorld *world, rbRigidBody *object, con
|
|||||||
*r_hit = 0;
|
*r_hit = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
/* we need to return a value if user passes non convex body, to report */
|
/* we need to return a value if user passes non convex body, to report */
|
||||||
*r_hit = -2;
|
*r_hit = -2;
|
||||||
}
|
}
|
||||||
@ -972,7 +975,7 @@ rbConstraint *RB_constraint_new_motor(float pivot[3], float orn[4], rbRigidBody
|
|||||||
/* unlock motor axes */
|
/* unlock motor axes */
|
||||||
con->getTranslationalLimitMotor()->m_upperLimit.setValue(-1.0f, -1.0f, -1.0f);
|
con->getTranslationalLimitMotor()->m_upperLimit.setValue(-1.0f, -1.0f, -1.0f);
|
||||||
|
|
||||||
return (rbConstraint*)con;
|
return (rbConstraint *)con;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cleanup ----------------------------- */
|
/* Cleanup ----------------------------- */
|
||||||
|
@ -1293,7 +1293,7 @@ static void scene_update_object_func(TaskPool *pool, void *taskdata, int threadi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Update will decrease child's valency and schedule child with zero valency. */
|
/* Update will decrease child's valency and schedule child with zero valency. */
|
||||||
DAG_threaded_update_handle_node_updated(node,scene_update_object_add_task, pool);
|
DAG_threaded_update_handle_node_updated(node, scene_update_object_add_task, pool);
|
||||||
|
|
||||||
#undef PRINT
|
#undef PRINT
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user