About Store Forum Documentation Contact



Post Reply 
Physics use
Author Message
Babulesnik Offline
Member

Post: #1
Physics use
Physics use. There are two meshes:
Table - table.mesh
Cube - cube.mesh
It is necessary to make that the cube fell on a table. The example "Phisical meshes" differs from my problem a little and it is difficult to me to understand.

If someone did similar, the big request to show code realisation.
12-24-2010 03:17 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Physics use
Please use the Editor, create objects from mesh and create their physical bodies.
12-24-2010 03:48 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #3
RE: Physics use
(12-24-2010 03:48 PM)Esenthel Wrote:  Please use the Editor, create objects from mesh and create their physical bodies.

Thanks. I have received a file cube.phys That with it to do???
12-24-2010 04:17 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #4
RE: Physics use
You need to add that with the object manager in the WE.

There is always evil somewhere, you just have to look for it properly.
12-24-2010 05:59 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #5
RE: Physics use
(12-24-2010 05:59 PM)Dynad Wrote:  You need to add that with the object manager in the WE.

Thanks. But how to realise it a code, without World Editor.
12-24-2010 06:27 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #6
RE: Physics use
Well if you created the Obj file in the WE.. you can easily call this func: Game::ObjParams &item=*Game::Objs("obj/item/a/0.obj");

There is always evil somewhere, you just have to look for it properly.
12-24-2010 07:20 PM
Visit this user's website Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #7
RE: Physics use
Code:
Phys ph; ph.load(...);
actor.create(ph);
Or something like that. Then mesh.matrix(actor.matrix()) //this is only necessary if you don't use build-in types
12-24-2010 07:44 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #8
RE: Physics use
(12-24-2010 07:44 PM)menajev Wrote:  
Code:
Phys ph; ph.load(...);
actor.create(ph);
Or something like that. Then mesh.matrix(actor.matrix()) //this is only necessary if you don't use build-in types

If I write "Phys ph;" an error. "Phys" it is not declared ....
12-24-2010 08:43 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #9
RE: Physics use
Now it's PhysBody or PhysBodyPtr
12-25-2010 12:13 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #10
RE: Physics use
Why force on Actor does not operate?

Mesh mshg;
PhysGroup phsg;
Actor actor;
mshg.load ("D:/EsenthelEngineSDK/Data/Obj/chr/Stol/stol.mesh");
mshg.scale (0.02);
phsg.create (mshg);
actor.create (phsg.phys (0));

if (Kb.b (KB_W)) actor.addVel (Vec (0,10,0)); or actor.addForce (Vec (0,10,0) *10);
12-27-2010 07:31 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #11
RE: Physics use
Phys from mesh can be static only. You need to use convex or shapes
12-28-2010 01:41 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #12
RE: Physics use
(12-28-2010 01:41 PM)Esenthel Wrote:  Phys from mesh can be static only. You need to use convex or shapes

Thank you very much.
12-28-2010 06:46 PM
Find all posts by this user Quote this message in a reply
Post Reply