Babulesnik
Member
|
Look angles for Game::Item and other class
It is very necessary to send over the network tilt angles of the object along the three axes x, y, z . This is implemented in the class Game:: Chr
Code:
STRUCT(Chr , Obj) // Game Character Object
//{
...
Vec2 angle ; // look angles
...
}
But only on the two axes x and y.
In my game, the object rotates on three axes.And I need to send over the network 3 angle + pos.I use the class Game::Item.But in the future may need to determine the angles and for other classes.
(This post was last modified: 01-07-2012 11:21 AM by Babulesnik.)
|
|
01-07-2012 11:17 AM |
|
neo22
Member
|
RE: Look angles for Game::Item and other class
Hi Babulesnik
To get those angle you can use the object matrix.
for characters you also have anim.fly_z that give you the z angle of the character.
|
|
01-07-2012 12:02 PM |
|
Babulesnik
Member
|
RE: Look angles for Game::Item and other class
(01-07-2012 12:02 PM)neo22 Wrote: Hi Babulesnik
To get those angle you can use the object matrix.
for characters you also have anim.fly_z that give you the z angle of the character.
Thanks but I've already tried this option from the outset.Here is a link to my topic at the angles of the matrix
|
|
01-07-2012 06:40 PM |
|
Driklyn
Member
|
RE: Look angles for Game::Item and other class
You can't just send matrix().angles() ? This has x, y, z rotations.
|
|
01-07-2012 10:28 PM |
|
Babulesnik
Member
|
RE: Look angles for Game::Item and other class
(01-07-2012 10:28 PM)Driklyn Wrote: You can't just send matrix().angles() ? This has x, y, z rotations.
I have such an option does not work properly((
Code:
if(Kb.bp(KB_R))
{
static Flt x;
x+=0.1;
ItemsBowling[1].matrix(ItemsBowling[1].matrix().setRotateX(x));
Vec angles = ItemsBowling[1].matrix().angles();
Vec pos = ItemsBowling[2].pos();
ItemsBowling[2].matrix(ItemsBowling[2].matrix().rotateXY(angles.x,angles.y).rotateZ(angles.z));
ItemsBowling[2].pos(pos);
}
|
|
01-25-2012 03:25 PM |
|
Driklyn
Member
|
RE: Look angles for Game::Item and other class
I think it needs to be: ItemsBowling[2].matrix().setRotateXY(x, y).rotateZ(z).move(pos)
|
|
01-30-2012 08:00 AM |
|
Babulesnik
Member
|
RE: Look angles for Game::Item and other class
(This post was last modified: 01-30-2012 10:04 AM by Babulesnik.)
|
|
01-30-2012 10:03 AM |
|
Babulesnik
Member
|
RE: Look angles for Game::Item and other class
why this strange behavior?
|
|
02-03-2012 05:24 PM |
|
Babulesnik
Member
|
RE: Look angles for Game::Item and other class
Has anyone encountered this problem? What are the options can still solve this problem? I tried many different options but I can not understand why the code does not work(((
|
|
02-08-2012 03:43 PM |
|
fatcoder
Member
|
RE: Look angles for Game::Item and other class
Looks like your rotating around the origin, which is in the center of the mesh. Go into your moddeling software and move the origin to the base of the mesh.
|
|
02-08-2012 10:52 PM |
|