[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - How to rotate cpSegmentShapeNew type of body @60 degree when

How to rotate cpSegmentShapeNew type of body @60 degree when

Official forum for the .

How to rotate cpSegmentShapeNew type of body @60 degree when

Postby iphonemobdev » Thu Aug 06, 2009 12:59 am

iphonemobdev
 
Posts: 10
Joined: Tue Aug 04, 2009 12:38 am

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby slembcke » Thu Aug 06, 2009 2:16 am

Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby iphonemobdev » Thu Aug 06, 2009 2:28 am

Thanks slembcke.

Actually i am confused that what to do so i was trying to put some code.
Actually i want to set angle and rotate this body with sprite. When user touch, it rotate at 60 degree and when user cancel the touch, it go to the original position. so how can i set angle and match with velocity?. Actually i tried to do using body->a = setAngle... but it gives me error.

There is no any example also there i can see this body rotation.

Thanks for reply and seek another reply.

Thanks.
iphonemobdev
 
Posts: 10
Joined: Tue Aug 04, 2009 12:38 am

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby iphonemobdev » Thu Aug 06, 2009 5:53 am

Hello please give me point that what should i give for body->w and how can i rotate this body?.
iphonemobdev
 
Posts: 10
Joined: Tue Aug 04, 2009 12:38 am

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby slembcke » Thu Aug 06, 2009 12:14 pm

Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby iphonemobdev » Thu Aug 06, 2009 11:37 pm

Hi slembcke,

Thanks for reply.

I don't want to do every time. When user touch the screen, it will rotate for 60 degree and when user cancel the touch event, it will rotate and again set t original position. So i think that i can not use dt.

Thanks.
iphonemobdev
 
Posts: 10
Joined: Tue Aug 04, 2009 12:38 am

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby slembcke » Fri Aug 07, 2009 9:36 am

Make it rotate in one direction when they are touching the screen and the other when they aren't. Stop it's rotation when it gets to the limits.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby iphonemobdev » Sat Aug 08, 2009 12:40 am

iphonemobdev
 
Posts: 10
Joined: Tue Aug 04, 2009 12:38 am

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby slembcke » Sat Aug 08, 2009 4:31 pm

You should seriously consider using a fixed size timestep anyway. It will produce a much more stable simulation, and you always know what to use as the timestep.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: How to rotate cpSegmentShapeNew type of body @60 degree when

Postby iphonemobdev » Sun Aug 09, 2009 11:29 pm

Hi Slembcke,

Thanks for giving me reply again and again.

Yes you are right that i should use timestep. I tried get dt from timer method and put in touch method. But i faced one problem is body->w. If i put this body->w then another body sprite also get affected from this body->w.

I have segment shape with two point, (200, 80) (280, 120). So first point should rotate and second point should stay at same point and you told me do this "Make it rotate in one direction when they are touching the screen and the other when they aren't. Stop it's rotation when it gets to the limits." But how can i do by coding?. Please give some clues in coding.

Today i have to solve this issue. I am really stuck with this problem and there is no any sample code to do this.

Please give me reply so i can solve it today it self.

Thanks.
iphonemobdev
 
Posts: 10
Joined: Tue Aug 04, 2009 12:38 am

Next

Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 4 guests

cron