예제 #1
0
        public void SetParameter(int nProp, Parameter value)
        {
            int num = PropertyFunc.ExGetNumProps(base.m_pItem);

            if ((nProp >= 0) && (nProp < num))
            {
                bool flag = false;
                if (PropertyFunc.ExGetPropType(base.m_pItem, nProp) == 1)
                {
                    flag = PropertyFunc.ExSetInt(base.m_pItem, nProp, value.IntValue) != 0;
                }
                else if (PropertyFunc.ExGetPropType(base.m_pItem, nProp) == 2)
                {
                    flag = PropertyFunc.ExSetFloat(base.m_pItem, nProp, value.FloatValue) != 0;
                }
                else if (PropertyFunc.ExGetPropType(base.m_pItem, nProp) == 3)
                {
                    flag = PropertyFunc.ExSetBool(base.m_pItem, nProp, value.BoolValue ? -1 : 0) != 0;
                }
                if (flag)
                {
                    PropertyFunc.ExSetDirty(base.m_pItem, nProp);
                }
            }
        }
예제 #2
0
        public override RigidBody GetOwner()
        {
            IntPtr pFunc = PropertyFunc.ExGetFunc(base.m_pItem, 0);
            IntPtr pItem = PropertyFunc.ExFuncInvokeObject(pFunc);

            PropertyFunc.ExFuncRelease(pFunc);
            return(RuntimeObject.FromPtr(pItem) as RigidBody);
        }
예제 #3
0
        public bool IsMember(RigidBody body)
        {
            IntPtr pFunc = PropertyFunc.ExGetFunc(base.m_pItem, 3);

            PropertyFunc.ExSetFuncArgObject(pFunc, 0, body.GetPtr());
            bool flag = PropertyFunc.ExFuncInvokeBool(pFunc) != 0;

            PropertyFunc.ExFuncRelease(pFunc);
            return(flag);
        }
예제 #4
0
        public bool IsMember(CollisionBody part)
        {
            IntPtr pFunc = PropertyFunc.ExGetFunc(base.m_pItem, 3);

            PropertyFunc.ExSetFuncArgObject(pFunc, 0, part.GetPtr());
            bool flag = PropertyFunc.ExFuncInvokeBool(pFunc) != 0;

            PropertyFunc.ExFuncRelease(pFunc);
            return(flag);
        }
예제 #5
0
        public void ApplyTorque(Vector3 torque)
        {
            IntPtr pFunc = PropertyFunc.ExGetFunc(base.m_pItem, 3);

            PropertyFunc.ExSetFuncArgFloat(pFunc, 0, torque.x);
            PropertyFunc.ExSetFuncArgFloat(pFunc, 1, torque.y);
            PropertyFunc.ExSetFuncArgFloat(pFunc, 2, torque.z);
            PropertyFunc.ExFuncInvokeVoid(pFunc);
            PropertyFunc.ExFuncRelease(pFunc);
        }
예제 #6
0
        public void ApplyForce(Vector3 force)
        {
            IntPtr pFunc = PropertyFunc.ExGetFunc(base.m_pItem, 2);

            PropertyFunc.ExSetFuncArgFloat(pFunc, 0, force.x);
            PropertyFunc.ExSetFuncArgFloat(pFunc, 1, force.y);
            PropertyFunc.ExSetFuncArgFloat(pFunc, 2, force.z);
            PropertyFunc.ExFuncInvokeVoid(pFunc);
            PropertyFunc.ExFuncRelease(pFunc);
        }
예제 #7
0
        public Parameter GetParameter(int nProp)
        {
            Parameter parameter = new Parameter();
            int       num       = PropertyFunc.ExGetNumProps(base.m_pItem);

            if ((nProp >= 0) && (nProp < num))
            {
                if (PropertyFunc.ExGetPropType(base.m_pItem, nProp) == 1)
                {
                    parameter.SetValue(PropertyFunc.ExGetInt(base.m_pItem, nProp));
                    return(parameter);
                }
                if (PropertyFunc.ExGetPropType(base.m_pItem, nProp) == 2)
                {
                    parameter.SetValue(PropertyFunc.ExGetFloat(base.m_pItem, nProp));
                    return(parameter);
                }
                if (PropertyFunc.ExGetPropType(base.m_pItem, nProp) == 3)
                {
                    parameter.SetValue(PropertyFunc.ExGetBool(base.m_pItem, nProp) != 0);
                }
            }
            return(parameter);
        }
예제 #8
0
 public int GetNumParameters()
 {
     return(PropertyFunc.ExGetNumProps(base.m_pItem));
 }