Help on StaticMesh and Entity
Posted: Tue Jun 14, 2011 3:20 pm
Hello,
To give a background, I am going through my first 6 months of Game development experience. I am somewhat new to XNA and absolutely new to Bepu. I am working on developing a baseball type of game(not baseball exactly). So of course I need a playing field, a player who hits, few players who stops the ball and 1 who throws the ball.
So I have a 3D model of the playing field (implemented as a thin cylinder), for which I created a StaticMesh (I assume this is correct way to go for a playing field). I have a 3D model of a ball (implemented as a sphere). So I Initialized a Sphere in Bepu representing the Ball. I am keeping those at 1 units (radius and Mass) as I read the physics works best for values 0.5 -10. What I am observing is that if I throw the ball towards the ground, it skids to the edge of the field, then goes past the field for some distance and then falls off. I expect it to fall right when the field ends, because the field model is kept at default scale. Why this might be happening?
Like real balls I would like to implement a rotating ball when ball moves along ground, but right now, after ball hits the ground it mostly slides and doesn't rotate? What is the appropriate way to make the ball rotate when its moving along the ground? Will making changes to Friction of the Staticmesh help? I am also confused when to use StaticFriction and when to use KineticFriction in real game dev scenarios.
Now regarding my players,
1) 1 Player(human model) who hits the ball with a bat. The Bat is part of the Human model. I need approximate collision detection for entire body but precise collision detection for the Bat (like ball deviating from travel direction if hits the edge.), what are the ways to implement this (represent the human model with bat in Physics Environment and have relatively precise collision detection for bat) in Bepu. My model would have predefined animations for variety of shots, running etc and there would be per bone transformations as well for (to handle things like wrist movement)
2) For fielders who stop the ball, I am thinking of creating a "bigger" box around the player with center positioned at Player's center. Then when the ball collides with the outer Box, I can have Collision event handlers to play specific animation, like dive for catch or simply bend down and pick up ball, then I need to check for collision events at mesh level(collision with hands) to pick up the ball. Once that is done, the fielder needs to throw the ball. For that, the game knows the approximate destination , speed of throw, but the throwing angle (projectile) needs to be calculated. Is the whole thing possible and do we have helper functions to calculate these things (like throwing angle).
To give a background, I am going through my first 6 months of Game development experience. I am somewhat new to XNA and absolutely new to Bepu. I am working on developing a baseball type of game(not baseball exactly). So of course I need a playing field, a player who hits, few players who stops the ball and 1 who throws the ball.
So I have a 3D model of the playing field (implemented as a thin cylinder), for which I created a StaticMesh (I assume this is correct way to go for a playing field). I have a 3D model of a ball (implemented as a sphere). So I Initialized a Sphere in Bepu representing the Ball. I am keeping those at 1 units (radius and Mass) as I read the physics works best for values 0.5 -10. What I am observing is that if I throw the ball towards the ground, it skids to the edge of the field, then goes past the field for some distance and then falls off. I expect it to fall right when the field ends, because the field model is kept at default scale. Why this might be happening?
Like real balls I would like to implement a rotating ball when ball moves along ground, but right now, after ball hits the ground it mostly slides and doesn't rotate? What is the appropriate way to make the ball rotate when its moving along the ground? Will making changes to Friction of the Staticmesh help? I am also confused when to use StaticFriction and when to use KineticFriction in real game dev scenarios.
Now regarding my players,
1) 1 Player(human model) who hits the ball with a bat. The Bat is part of the Human model. I need approximate collision detection for entire body but precise collision detection for the Bat (like ball deviating from travel direction if hits the edge.), what are the ways to implement this (represent the human model with bat in Physics Environment and have relatively precise collision detection for bat) in Bepu. My model would have predefined animations for variety of shots, running etc and there would be per bone transformations as well for (to handle things like wrist movement)
2) For fielders who stop the ball, I am thinking of creating a "bigger" box around the player with center positioned at Player's center. Then when the ball collides with the outer Box, I can have Collision event handlers to play specific animation, like dive for catch or simply bend down and pick up ball, then I need to check for collision events at mesh level(collision with hands) to pick up the ball. Once that is done, the fielder needs to throw the ball. For that, the game knows the approximate destination , speed of throw, but the throwing angle (projectile) needs to be calculated. Is the whole thing possible and do we have helper functions to calculate these things (like throwing angle).