| 4384 | } |
| 4385 | |
| 4386 | int LuaSetEuler(lua_State* L) |
| 4387 | { |
| 4388 | HNode hnode; |
| 4389 | InternalNode* n = LuaCheckNodeInternal(L, 1, &hnode); |
| 4390 | if (n->m_Node.m_IsBone) { |
| 4391 | return 0; |
| 4392 | } |
| 4393 | Quat r; |
| 4394 | Vector4 v; |
| 4395 | Vector3* v3; |
| 4396 | Vector4* v4; |
| 4397 | if ((v3 = dmScript::ToVector3(L, 2))) |
| 4398 | { |
| 4399 | v = Vector4(*v3, 0.0f); |
| 4400 | r = dmVMath::EulerToQuat(v.getXYZ()); |
| 4401 | } |
| 4402 | else if ((v4 = dmScript::ToVector4(L, 2))) |
| 4403 | { |
| 4404 | v = *v4; |
| 4405 | r = dmVMath::EulerToQuat(v.getXYZ()); |
| 4406 | } |
| 4407 | else |
| 4408 | { |
| 4409 | return luaL_argerror(L, 2, "Valid types are vmath.vector3 and vmath.vector4"); |
| 4410 | } |
| 4411 | |
| 4412 | n->m_Node.m_Properties[PROPERTY_ROTATION] = Vector4(r); |
| 4413 | n->m_Node.m_Properties[PROPERTY_EULER] = v; |
| 4414 | n->m_Node.m_DirtyLocal = 1; |
| 4415 | return 0; |
| 4416 | } |
| 4417 | |
| 4418 | void SetDefaultNewContextParams(NewContextParams* params) |
| 4419 | { |
nothing calls this directly
no test coverage detected