// // 设置世界缩放 // VOID CSceneNode::SetWorldScale(FLOAT x, FLOAT y, FLOAT z) { if (m_pParentNode) { // 算法: // worldScale = localScale * parentScale // localScale = worldScale / parentScale VEC3 localScale; VEC3 worldScale; Vec3Set(&worldScale, x, y, z); Vec3Div(&localScale, &worldScale, m_pParentNode->GetWorldScale()); x = localScale[0]; y = localScale[1]; z = localScale[2]; } SetLocalScale(x, y, z); }
//-------------------------------------------------------------------------------------------------------------- void Vector3::operator /= ( const Vector3& v3 ) { Vec3Div( this, this, &v3 ); }
//-------------------------------------------------------------------------------------------------------------- Vector3 Vector3::operator / ( const Vector3& v3 ) const { static Vector3 tmp; Vec3Div( &tmp, this, &v3 ); return tmp; }