Box2D Forums

It is currently Tue May 21, 2013 7:16 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Sun Aug 03, 2008 12:44 pm 
Offline

Joined: Thu Jul 17, 2008 11:24 am
Posts: 54
huesforalice wrote:

@maroxe: What exactly do you mean by "heightfiled terrain"? The terrain is composed of boxes, but as soon as I give you the aforementioned link, you'll be able to understand how it's built.


me wrote:
a heightfield terrain, it's something like that:

Image


and i want to assign to it a shape like that:


Image


Top
 Profile  
 
PostPosted: Sun Aug 03, 2008 12:46 pm 
Offline

Joined: Mon Jan 07, 2008 10:51 am
Posts: 1911
Also, bugreport:
Attachment:
tinger.png
tinger.png [ 445.27 KiB | Viewed 1582 times ]

While attempting to jump from the ground directly onto that platform. He's standing at an angle.


Top
 Profile  
 
PostPosted: Mon Aug 04, 2008 1:59 am 
Offline

Joined: Sat Aug 02, 2008 11:37 am
Posts: 7
@Boris: I'd have to check the code again, but I'm pretty sure that I'm only setting the velocity. I also aply a counterforce to gravity as long as he is not moving and touching the ground, so that he doesn't slip down the slopes. About your bug report, the angle that tinger stands in is defined by the normalvector of his collission with ground. So if he stands on the edge of a collissionbox, he'll stand at an angle. I don't really consider this to be a serious bug, but thanks for pointing it out!

@maroxe: I'll go into detail about that in my upcoming blogentry. I'll post you the link in this thread.


Top
 Profile  
 
PostPosted: Mon Aug 04, 2008 5:32 am 
Offline

Joined: Thu Jul 17, 2008 11:24 am
Posts: 54
ok


Top
 Profile  
 
PostPosted: Tue Aug 05, 2008 7:03 am 
Offline

Joined: Thu Jul 17, 2008 11:24 am
Posts: 54
and how do you limit rotation of your charactere controller?


Top
 Profile  
 
PostPosted: Fri Aug 08, 2008 4:28 pm 
Offline

Joined: Fri May 16, 2008 10:09 am
Posts: 337
Would be nice if it weren't limited to 24fps (on a 4ghz core 2 duo here)... I'm a first person shooter player so I absolutely despise low framerates. Changing that to a max of 40+ would increase my enjoyment tenfold.


Top
 Profile  
 
PostPosted: Sun Aug 17, 2008 9:48 am 
Offline

Joined: Sat Aug 02, 2008 11:37 am
Posts: 7
Please check out: http://www.huesforalice.com/project/box2d_tinger to answer some of your questions. There is a version of the game with a physics debug view online as well, which hopefully will help you understand some of the details.

@dc443: The computation of the game is based on the framerate, so at the moment the game would be running twice as fast if i put it up to 50 frames. But you're right, the next time I'll try and implement the game so that the framerate isn't limited.


Top
 Profile  
 
PostPosted: Mon Aug 18, 2008 3:14 am 
Offline

Joined: Thu Jul 17, 2008 11:24 am
Posts: 54
:D i am thankfull


Top
 Profile  
 
PostPosted: Mon Aug 18, 2008 3:31 am 
Offline

Joined: Thu Jul 17, 2008 11:24 am
Posts: 54
Code:
The angle at which the characters stand is determined by the collission vector between every character and the ground object it is standing on.
how do you perform that?
Code:
void MyContactListener::Add  ( const b2ContactPoint *  point   )  {
//point->shape2 is the character controller
b2Vector2 original(0, 1);
b2Mat22 mat(orginal, point->normal);
point->shape2->setXForm(body>getPosition(), mat.GetAngle());
}
???


Top
 Profile  
 
PostPosted: Mon Aug 18, 2008 10:59 am 
Offline

Joined: Mon Jan 07, 2008 10:51 am
Posts: 1911
Thanks, that's pretty cool. You've obviously made a pretty nice level editor there, as well as a game, judging by the screenshot.

I'm astonished how effective it is setting a one way platform just by setting and unsetting it's solidity.. That basically solves the problem as far as I'm concerned, which is good as it's a reasonably frequent question on these boards. It's a pity how you can get Tinger to stand on the corner of the platforms at an angle, but I don't think that is too hard to resolve either.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group