15 [
Attribute(
"0",
UIWidgets.Slider,
"Minimum rotate range in degrees (if minimum is higher than maximum, slider can rotate freely)",
"-180 0 0.01")]
17 [
Attribute(
"0",
UIWidgets.Slider,
"Maximum rotate range in degrees (if minimum is higher than maximum, slider can rotate freely)",
"0 180 0.01")]
19 [
Attribute(
"0",
UIWidgets.Slider,
"Minimum movement range in meters (if minimum is higher than maximum, slider can move along its axis freely)",
"-50 0 0.01")]
21 [
Attribute(
"0",
UIWidgets.Slider,
"Maximum movement range in meters (if minimum is higher than maximum, slider can move along its axis freely)",
"0 50 0.01")]
27 override void DebugDisplay()
36 const float addVisAng = 0;
39 if (m_RotateMax > m_RotateMin)
40 sliceSubDiv =
Math.Ceil(
Math.AbsFloat(-m_RotateMax - -m_RotateMin) / 360 * 16);
51 CreateCircleSlice(axisVec * m_MoveMin + pos, axisVec, axisVec3, -m_RotateMax + addVisAng, -m_RotateMin + addVisAng, 0.075,
ARGB(255, 0, 255, 255), sliceSubDiv,
ShapeFlags.ONCE|
ShapeFlags.NOZBUFFER);
52 CreateCircleSlice(axisVec * m_MoveMax + pos, axisVec, axisVec3, -m_RotateMax + addVisAng, -m_RotateMin + addVisAng, 0.075,
ARGB(255, 0, 255, 255), sliceSubDiv,
ShapeFlags.ONCE|
ShapeFlags.NOZBUFFER);
60 override void RotateJoint(inout
vector jointMat[4])
62 vector oldJointMat[3], rotMat[3];
63 oldJointMat[0] = jointMat[0];
64 oldJointMat[1] = jointMat[1];
65 oldJointMat[2] = jointMat[2];
66 Math3D.AnglesToMatrix(
"-90 0 0", rotMat);
67 Math3D.MatrixMultiply3(oldJointMat, rotMat, jointMat);
74 m_Joint =
PhysicsJoint.CreateSlider(parent, child, jointMat1, jointMat2, m_CollisionBlocker, -1);
76 jointSlider.SetLinearLimits(m_MoveMin, m_MoveMax);
78 jointSlider.SetAngularLimits(1, -1);
80 jointSlider.SetAngularLimits(-m_RotateMax *
Math.DEG2RAD, -m_RotateMin *
Math.DEG2RAD);
Shape CreateCircleSlice(vector pos, vector aroundDir, vector forwardDir, float angMin, float angMax, float radius, int color, int subdivisions, ShapeFlags flags)
Shape CreateCircle(vector pos, vector aroundDir, float radius, int color, int subdivisions, ShapeFlags flags)
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.