About Store Forum Documentation Contact
Donations:
345$/mo



Post Reply 
Look angles for Game::Item and other class
Author Message
Babulesnik Offline
Member

Post: #1
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
Find all posts by this user Quote this message in a reply
neo22 Offline
Member

Post: #2
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
Visit this user's website Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #3
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
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #4
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
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #5
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
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #6
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
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #7
RE: Look angles for Game::Item and other class
(01-30-2012 08:00 AM)Driklyn Wrote:  I think it needs to be: ItemsBowling[2].matrix().setRotateXY(x, y).rotateZ(z).move(pos)

thank you vary much but it is not working properly(
Code:
    if(Kb.bp(KB_R))
    {
        x+=0.1;
        Vec pos_1 = ItemsBowling[1].pos(),
            pos_2 = ItemsBowling[2].pos();

        ItemsBowling[1].matrix(ItemsBowling[1].matrix().setRotateX(x).move(pos_1));
        Vec angles = ItemsBowling[1].matrix().angles();

        ItemsBowling[2].matrix(ItemsBowling[2].matrix().setRotateXY(angles.x,angles.y).rotateZ(angles.z).move(pos_2));
    }

   
   
   
   
   
   
   
(This post was last modified: 01-30-2012 10:04 AM by Babulesnik.)
01-30-2012 10:03 AM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #8
RE: Look angles for Game::Item and other class
why this strange behavior?
02-03-2012 05:24 PM
Find all posts by this user Quote this message in a reply
Babulesnik Offline
Member

Post: #9
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
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #10
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
Find all posts by this user Quote this message in a reply
Post Reply