8pose_event::pose_event(
const float *_pose,
const float *_last_pose,
unsigned short _player_index,
short _trackable_index,
double _time)
9 :
event(
EID_POSE,0,0,_time), player_index(_player_index), trackable_index(_trackable_index)
11 std::copy(_pose, _pose + 12,
pose);
12 std::copy(_last_pose, _last_pose + 12,
last_pose);
23 return trackable_index;
29 os <<
"x(" <<
pose[0] <<
"," <<
pose[1] <<
"," <<
pose[2] <<
");";
30 os <<
"y(" <<
pose[3] <<
"," <<
pose[4] <<
"," <<
pose[5] <<
");";
31 os <<
"z(" <<
pose[6] <<
"," <<
pose[7] <<
"," <<
pose[8] <<
");";
32 os <<
"O(" <<
pose[9] <<
"," <<
pose[10] <<
"," <<
pose[11] <<
");";
33 os <<
"<" << player_index <<
":" << trackable_index <<
">";
39 std::cerr <<
"not implemented" << std::endl;
45 return reinterpret_cast<const mat3&
>(
pose[0]);
51 return reinterpret_cast<const vec3&
>(
pose[9]);
56 return reinterpret_cast<const mat3x4&
>(
pose[0]);
virtual void stream_out(std::ostream &os) const
write to stream
const mat3 & get_orientation() const
return current orientation matrix
pose_event(const float *_pose, const float *_last_pose, unsigned short _player_index, short _trackable_index=0, double _time=0)
construct a key event from its textual description
const vec3 & get_last_position() const
return last position
const mat3x4 & get_last_pose_matrix() const
return last pose matrix
float pose[12]
pose stored as 3x4 matrix in column major format
const vec3 & get_position() const
return current position
mat3 get_rotation_matrix() const
return rotation matrix between from the last to current orientation
const mat3 & get_last_orientation() const
return last orientation matrix
quat get_last_quaternion() const
return last orientation quaternion
vec3 get_different() const
return difference vector from last to current position
unsigned get_player_index() const
return player index
quat get_quaternion() const
return current orientation quaternion
void stream_in(std::istream &is)
read from stream
const mat3x4 & get_pose_matrix() const
return current pose matrix
int get_trackable_index() const
return trackable index
void stream_out(std::ostream &os) const
write to stream
quat get_rotation_quaternion() const
return rotation quaternion between from the last to current orientation
float last_pose[12]
last pose as 3x4 matrix
@ EID_POSE
id for a 6D pose change events
cgv::math::quaternion< float > quat
declare type of quaternion