Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
bounce? #289595
09/14/09 10:56
09/14/09 10:56
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
Hi,

I've got a problem with the bounce function.. this is just like a bouncing ball with z-going up/down and y-sidetoside..

Therefore I used
Code:
void	ball_move()
{
	c_move(me, vector(0, 0, move_speed*time_step), nullvector, IGNORE_PASSABLE | GLIDE);
	if (trace_hit)	{ vec_to_angle(my.pan, bounce); }
}



The above function is in a while loop, the ball will move going up but when it hits entities it got stuck and no bouncing happens.. Why? I know that there should be something wrong with the Euler's angle.. I've already tried to add these codes if the ball hits the entities but still no luck.
Code:
vec_to_angle(my.pan, bounce);
	my.pan   = 0;
	my.tilt  = 0;
	my.roll += 5 - random(10);
	my.x		= 0;



x - should be zero...

Please advise



Can't is not an option™
Re: bounce? [Re: seecah] #289605
09/14/09 12:36
09/14/09 12:36
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Change to:
Code:
c_move(me, vector(move_speed*time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);

...since local x is the direction the entity is pointing.

Your code instead makes the entity point along the bounce vector, even though it wasn't pointing along its original vector in the first place. Then it moves "up" relative to the direction it's looking now, instead of just moving in the actual direction it's looking.

I hope that's what you're looking for.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: bounce? [Re: JibbSmart] #289621
09/14/09 14:18
09/14/09 14:18
Joined: Apr 2009
Posts: 248
Philippines
seecah Offline OP
Member
seecah  Offline OP
Member

Joined: Apr 2009
Posts: 248
Philippines
I've tried but it'll go away from the camera of course since it keeps on adding it's x value.. It should not be that way..



Can't is not an option™
Re: bounce? [Re: seecah] #289640
09/14/09 15:33
09/14/09 15:33
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Make it face up instead of facing the same direction as the camera.

By using the first vector in c_move, all motions are relative to the object's orientation.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1