Oh wow, isn't that amassing, the collision is so good that it get the playe on that corner.
That will be fix in my next check it because will change the cylinder wit two capsules, that way if it lands on that place again, it will slide out.
Moderators: Sascha Willems, walaber
Enclave wrote:I have some problems with bodies.
I create the dynamic bodies and player. The dynamic bodies present in a game as a boxes. I get strange behavior of these bodies.
Boxes fall through the floor slightly and freeze standing on its corners. I can not understand what the problem is, probably where I'm doing something wrong initialization? Do you have any ideas why this happens?
dVector size (64.0f, 64.0f, 64.0f, 0.0f);
dMatrix shapeOffsetMatrix (GetIdentityMatrix());
NewtonCollision* collision = NULL;
collision = NewtonCreateBox (pGame->pPhysics->GetWorld(), size.m_x, size.m_y, size.m_z, 0, NULL);
dMatrix matrix (shapeOffsetMatrix);
matrix.m_front = matrix.m_front.Scale (1.0f / dSqrt (matrix.m_front % matrix.m_front));
matrix.m_right = matrix.m_front * matrix.m_up;
matrix.m_right = matrix.m_right.Scale (1.0f / dSqrt (matrix.m_right % matrix.m_right));
matrix.m_up = matrix.m_right * matrix.m_front;
NewtonCollisionSetMatrix(collision, &matrix[0][0]);
// pointer to rigid body
body = pGame->pPhysics->CreateSimpleSolid(&m_object, 16.0f, matrix, collision, 0);
NewtonDestroyCollision (collision);
//#define PLAYER_WALK_SPEED 4.0f
#define PLAYER_WALK_SPEED 80.0f
#define PLAYER_THIRD_PERSON_VIEW_DIST 330.0f
// make the player controller, this function makes a kinematic body
//m_controller = manager->CreatePlayer(80.0f, radius, radius * 0.5f, height, height * 0.33f, playerAxis);
m_controller = manager->CreatePlayer(60.0f, radius * 0.30f, radius * 0.15f, height, height * 0.33f, playerAxis);
// players by default have the origin at the center of the lower bottom of the collision shape.
// you can change this by calling SetPlayerOrigin, for example if a player has it origin at the center of the AABB you can call
m_controller->SetPlayerOrigin (height * 0.5f);
//BasicPlayerEntity* const player = new BasicPlayerEntity (scene, manager, 0.5f, 1.9f, location);
BasicPlayerEntity* const player = new BasicPlayerEntity (scene, manager, 44.243389f, 72.695694f, location);
you gravity must also be too huge, and that is what make the physic fail. It is losing floating point dynamics range precision everywhere
you need to scale you world
If you use 9.8f gravity, you need to treat the values as meters (1.0f = 1 meter), so your character is actually 72 meters high - a real big guy
I don't understand what you mean with texture size
Users browsing this forum: No registered users and 0 guests