Jump to content

ScaleEntity/Physic Problem


mdidillon
 Share

Recommended Posts

Hello everyone,

 

I bought LE Engine at the beginning of this week and finally have some time to play around with it. So far I really love it. I am using the C++ interface. Currently I am writing a little multiplayer physics game, just to get used of everything. I have some problems with ScaleEntity in combination with the physic/collision engine. If I create a body and a mesh and make the mesh child of the body and then scale the body entity, the collision/physics does not work anymore (the scaled object does not collide anymore with other objects). My first thought was that the body position and dimension is not equal to mesh representation, but physics debug mode showed that they are equal. Everything works fine if I set dimension of body and mesh separately, before it parent the body with the mesh.

 

Here is the code:

 

This works:

 

   TBody body=CreateBodyBox(2,2,2);
  SetBodyMass(body,1);
  TMesh mesh=CreateCube();
  ScaleEntity(mesh, Vec3(2,2,2));
  EntityParent(mesh,body)

 

This does NOT work (no collision/physic interaction anymore):

 

   TBody body=CreateBodyBox();
  SetBodyMass(body,1);
  TMesh mesh=CreateCube();
  EntityParent(mesh,body);
  ScaleEntity(body, Vec3(2,2,2));

 

Is this meant to be like that?

 

marc

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...