0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: 2.5D physics
[Re: Helghast]
#345465
10/26/10 16:06
10/26/10 16:06
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
Serious User
|
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
You do not have to enable it every frame with phent_enable, I posted my code, this works very fine for me. Or did you meant something else?
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: 2.5D physics
[Re: Helghast]
#345473
10/26/10 18:29
10/26/10 18:29
|
Joined: May 2009
Posts: 5,370 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,370
Caucasus
|
TheLiam, "phent_addcentralforce" works only with physical object, that doesn't have gravity, or am I wrong? I'm not gonna add any torque or force to my physical objects. I just need them to do not move in Y coordinates, if they for example fall from hight place and rebound from the floor or other objects. Simulation needs to look completely as in a 2D game, but with 3D models.
Helghast, do you mean something like this: /// while(1) { phent_enable(my,0); my.y = 0; phent_enable(my,1); wait(1); } ///// If not, please, explain a bit more. Thank you all guys, for helping me out.
|
|
|
Re: 2.5D physics
[Re: 3run]
#345482
10/26/10 19:30
10/26/10 19:30
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
(EDIT: for A7/ ODE: ) You can continuously add a force on its y-component to keep the entity on the x-z-plain, f.i. simply the negative y-distance. Alternatively, create an invisible map entity with two walls on the left and right side of the x-axis and place it at your physic entity's position each frame (that's how I do it in my sidescroller).
Last edited by Superku; 10/26/10 19:59.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: 2.5D physics
[Re: 3run]
#345483
10/26/10 19:31
10/26/10 19:31
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
Serious User
|
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Man! Yes, just try it like I wrote it. If you want to use vec_set then you have to phent_enable, but I can tell you it works with my way, really. And no, addcentralforce works for everything, the manual just says that if there is no friction or gravtitation it will fly there constantly (?) which is logic because there is no friction or gravity
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: 2.5D physics
[Re: Liamissimo]
#345487
10/26/10 19:57
10/26/10 19:57
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
oops srry didnt read the whole post
Last edited by flits; 10/26/10 20:38.
"empty"
|
|
|
Re: 2.5D physics
[Re: 3run]
#345496
10/26/10 21:21
10/26/10 21:21
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
The maximal size (any direction) of my player is ~90 quants. I've created a map entity consisting of two walls (none or flat texture), some 100 quants in height and width, parallel to the x-axis (I use x/z-movement, too). The y-distance between both walls is 128 quants, so my 90 quants player can freely rotate within these limits. When my player entity is stunned, I register it for the physics engine and vec_set(wall_map_entity.x,player.x) the position every frame. I only add torque around the y-axis and forces restricted to the x-/z-axis, so it does not look odd when (if ever) the player hits the invisible walls.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|