Vector3 issues...

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
dmortensen1
Posts: 1
Joined: Sat Oct 17, 2015 7:12 am

Vector3 issues...

Post by dmortensen1 »

Hi i am pretty new to BEPUPhysics (found out about it last night) and i am having some basic issues with Vector3 conversion... i'm using Monogame and i have a gamemodel class which contains the position, rotation and scaling of the gamemodel but now when i try to import the explosion (demo sample script) i have to switch constantly between different versions of Vector3 (sorry, i'm using a player script which inherits the gamemodel script to translate the player) and in my player script when i try to recreate the explosion script i get nothing... no "jumps" or anything, i should also mention i have created a simple jump in my player scripts Update function where i have replaced the position.Y (position in this case is from Xna.framework, NOT BEPUutilities!) out with Explode() to test it out, now i should lastly mention that i have only played with nvidia's physx when using Unity3D, but here i am trying to create my own game engine, and the physics is driving me nuts :P (have been "using" JitterPhysics until yesterday, which i didn't really use either because of my lack of understanding :( ) i hope there is a person in here who can help me out because i have no experience with BEPU and i actually really would like to use it in my game engine :)
Thanks in advance :)
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Vector3 issues...

Post by Norbo »

i am having some basic issues with Vector3 conversion... i'm using Monogame and i have a gamemodel class which contains the position, rotation and scaling of the gamemodel but now when i try to import the explosion (demo sample script) i have to switch constantly between different versions of Vector3
This can be mitigated a little by putting casts for the XNA/monogame types into the BEPUutilities types. It does introduce some overhead so it should be avoided in extremely tight loops, but it usually works well enough. An example of a custom expliict cast can be found here. Implicit casts would work too, and would avoid some typing.
and in my player script when i try to recreate the explosion script i get nothing... no "jumps" or anything, i should also mention i have created a simple jump in my player scripts Update function where i have replaced the position.Y (position in this case is from Xna.framework, NOT BEPUutilities!) out with Explode() to test it out
I'm not sure what you mean here, but here's a couple of guesses:
1) If you're using the BEPUphysics CharacterController type, its constraints will try to keep it from moving due to external impulses. To make a character move, the impulse needs to be large enough or the character needs to have its constraints forcefully disabled (e.g. force it to have no traction, or to jump).
2) If you're manually controlling the position of objects by e.g. setting the y component of the position every frame, the physical simulation will be unable to proceed correctly. Explosions won't cause any vertical movement because the position is being reset continuously.
Post Reply