Babulesnik
Member
|
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 |
|
Esenthel
Administrator
|
RE: Physics use
Please use the Editor, create objects from mesh and create their physical bodies.
|
|
12-24-2010 03:48 PM |
|
Babulesnik
Member
|
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 |
|
Dynad
Member
|
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 |
|
Babulesnik
Member
|
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 |
|
Dynad
Member
|
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 |
|
menajev
Member
|
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 |
|
Babulesnik
Member
|
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 |
|
Harry
Member
|
RE: Physics use
Now it's PhysBody or PhysBodyPtr
|
|
12-25-2010 12:13 AM |
|
Babulesnik
Member
|
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 |
|
Esenthel
Administrator
|
RE: Physics use
Phys from mesh can be static only. You need to use convex or shapes
|
|
12-28-2010 01:41 PM |
|
Babulesnik
Member
|
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 |
|