|
Re: Roll without changing my.z ...
[Re: Altarius]
#367098
04/09/11 20:12
04/09/11 20:12
|
Joined: Jul 2009
Posts: 85
Altarius
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 85
|
Well.... its imposible or my question are incomprehensible?
Last edited by Altarius; 04/09/11 20:12.
|
|
|
Re: Roll without changing my.z ...
[Re: Altarius]
#367099
04/09/11 20:38
04/09/11 20:38
|
Joined: Dec 2008
Posts: 1,660 North America
Redeemer
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,660
North America
|
Probably the latter..?
Perhaps you should show us your code.
Last edited by Redeemer; 04/09/11 20:38.
|
|
|
Re: Roll without changing my.z ...
[Re: Altarius]
#367101
04/09/11 21:04
04/09/11 21:04
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
Open your model in MED. How is the orentation of your model? Unless it is perfect center it will look to seem like it's moving around in a circle when spun. Thing of a ball on a string and spinning it around in a circle above your ahead. The center is your hand.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: Roll without changing my.z ...
[Re: FoxHound]
#367163
04/10/11 15:29
04/10/11 15:29
|
Joined: Jul 2009
Posts: 85
Altarius
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 85
|
Ok there's a exemple : ---------------------------------------------------- my.pan += 3* (key_a - key_d) * time_step; my.roll += 3* (key_d - key_a) * time_step; speed.x += 3 * (key_w - key_s) * time_step; speed.y += 3 * (key_z - key_c) * time_step;
c_move(my,speed,nullvector,IGNORE_PASSABLE|GLIDE) ----------------------------------------------------
When im moving on the X axis, if i change the .pan the entity now move following the pan angle... like a car...
Now there's my problem : When im moving on the Y axis, if i change the .roll the entity now move up or down following the roll angle...
I dont want my entity to change his movement direction if i change roll angle when i move on the Y axis...I just want it to continue to move regardless the .roll angle.
Last edited by Altarius; 04/10/11 15:35.
|
|
|
Re: Roll without changing my.z ...
[Re: Altarius]
#367165
04/10/11 15:38
04/10/11 15:38
|
Joined: Mar 2010
Posts: 56 Hertfordshire, England
Panda_Dude
Junior Member
|
Junior Member
Joined: Mar 2010
Posts: 56
Hertfordshire, England
|
so are you saying that the entity moves on the z axis only when its moving on the y axis and changing it's roll angle? Or does it appear to change on the z axis even when stationary on the y axis? If it does it while it's stationary then it has already been mentioned; the model is probably not centered properly.
Last edited by Panda_Dude; 04/10/11 15:39.
|
|
|
Re: Roll without changing my.z ...
[Re: MasterQ32]
#367202
04/10/11 19:30
04/10/11 19:30
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
One problem I see is that you constantly add to your move number. It should be speed.x = 3 ... Next is the your character will move like a car. Forward. So when pan and roll are changed so is forward. So you are moving more like a plane or space ship. To solve your pRoblem use richi's idea and some playing around.
Another idea is to record your z position before the movement and then set your mesh back to the z position.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: Roll without changing my.z ...
[Re: Altarius]
#367233
04/11/11 02:59
04/11/11 02:59
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Use the other vector parameter of c_move, rotated around just your pan:
c_move(my, nullvector, vec_rotate(speed, vector(my.pan, 0, 0)), IGNORE_PASSABLE|GLIDE);
That's the quick and dirty version -- in the process "speed" gets modified to be the character's absolute speed, rather than relative speed, so if instead of assigning values to speed's parameters you want to do stuff gradually over time, you'll need another VECTOR so you can do vec_rotate without changing your speed VECTOR. Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|