本文整理汇总了C++中Matrix32::orthonormalize方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix32::orthonormalize方法的具体用法?C++ Matrix32::orthonormalize怎么用?C++ Matrix32::orthonormalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix32
的用法示例。
在下文中一共展示了Matrix32::orthonormalize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant& p_variant) {
switch(p_state) {
case Physics2DServer::BODY_STATE_TRANSFORM: {
if (mode==Physics2DServer::BODY_MODE_KINEMATIC) {
new_transform=p_variant;
//wakeup_neighbours();
set_active(true);
if (first_time_kinematic) {
_set_transform(p_variant);
_set_inv_transform(get_transform().affine_inverse());
first_time_kinematic=false;
}
} else if (mode==Physics2DServer::BODY_MODE_STATIC) {
_set_transform(p_variant);
_set_inv_transform(get_transform().affine_inverse());
wakeup_neighbours();
} else {
Matrix32 t = p_variant;
t.orthonormalize();
new_transform=get_transform(); //used as old to compute motion
if (t==new_transform)
break;
_set_transform(t);
_set_inv_transform(get_transform().inverse());
}
wakeup();
} break;
case Physics2DServer::BODY_STATE_LINEAR_VELOCITY: {
//if (mode==Physics2DServer::BODY_MODE_STATIC)
// break;
linear_velocity=p_variant;
wakeup();
} break;
case Physics2DServer::BODY_STATE_ANGULAR_VELOCITY: {
//if (mode!=Physics2DServer::BODY_MODE_RIGID)
// break;
angular_velocity=p_variant;
wakeup();
} break;
case Physics2DServer::BODY_STATE_SLEEPING: {
//?
if (mode==Physics2DServer::BODY_MODE_STATIC || mode==Physics2DServer::BODY_MODE_KINEMATIC)
break;
bool do_sleep=p_variant;
if (do_sleep) {
linear_velocity=Vector2();
//biased_linear_velocity=Vector3();
angular_velocity=0;
//biased_angular_velocity=Vector3();
set_active(false);
} else {
if (mode!=Physics2DServer::BODY_MODE_STATIC)
set_active(true);
}
} break;
case Physics2DServer::BODY_STATE_CAN_SLEEP: {
can_sleep=p_variant;
if (mode==Physics2DServer::BODY_MODE_RIGID && !active && !can_sleep)
set_active(true);
} break;
}
}