Sledge Game

Discuss any questions about BEPUphysics or problems encountered.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Sledge Game

Post by Norbo »

I can't tell from the code what specific measurement you're looking for, but if you just want total rotation in radians, you can sum each frame's angular velocity magnitude * dt. Since the magnitude of angular velocity is radians per second (or more generally, time unit), the magnitude * dt is the radians per 'dt' interval. This is sort of like numerically integrating the arc length.
Marvin
Posts: 32
Joined: Wed Aug 04, 2010 9:16 pm

Re: Sledge Game

Post by Marvin »

Norbo wrote:I can't tell from the code what specific measurement you're looking for, but if you just want total rotation in radians, you can sum each frame's angular velocity magnitude * dt. Since the magnitude of angular velocity is radians per second (or more generally, time unit), the magnitude * dt is the radians per 'dt' interval. This is sort of like numerically integrating the arc length.
yes that was exactly it! really nice, it works really well. Thanks for all the help so far, I'm really liking the way it's turning out!

Now off to the next step, creating the shadows for a bit more realism. I was thinking about somekind colloring with a 1 by 1 black texture the pixels representing the shadows, and I then need to somehow trace where these shadows will need to be, probably raytracing every point of the character mesh to the ground. But I'm not sure if this would be fast enough for the device. or I could kind of fake it by making a 2d sideview of the model and then skewing it, but this will only look nice on the flat parts and very odd on the bumps.
I dont know if shadow mapping is possible since the phone does not support a hlsl shaders.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Sledge Game

Post by Norbo »

The kind of CPU raytracing that could run on the phone probably wouldn't look as good as traditional blob shadows: http://www.youtube.com/watch?v=CffC9hmGepE

Something like shadowmapping may be possible through tricky usage of the available shaders, but I'm the wrong person to ask about that :)
Marvin
Posts: 32
Joined: Wed Aug 04, 2010 9:16 pm

Re: Sledge Game

Post by Marvin »

haha exactly, well the shadows would be nice if they were perfect, but i'm not expecting anything like that. It's more to give the player a sense of direction and height, especially when up in the ait it's hard to notice how far the ground underneath is.
Is there a good way to draw a quad in bepu? since windows phone is lacking some features to draw it simple. I guess 2 triangels?

Then I could just add a semitransparant blob indead and just ray back one time from the center of the sledge to the terrain and scale it a bit based on the height, and the normals of the terrain. Using a capsule as the shadow object now, and it works quite oke, however a quad would be much nicer.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Sledge Game

Post by Norbo »

Is there a good way to draw a quad in bepu? since windows phone is lacking some features to draw it simple. I guess 2 triangels?
You could do that, but again, the debug drawer isn't exactly designed to do anything but draw physics engine stuff. The more it is relied upon for normal rendering, the greater the pain will be if the system needs to do something that doesn't fit nicely into its limited features.
Post Reply