53 float num2 =
ScoreMount(item, allowToStartRange);
68 ComponentCreature.ComponentBody.ParentBody = componentMount.
ComponentBody;
69 ComponentCreature.ComponentBody.ParentBodyPositionOffset =
Vector3.
Transform(
77 ComponentCreature.ComponentLocomotion.IsCreativeFlyEnabled =
false;
85 if (
Mount.DismountOffset.X > 0f) {
86 float s = Mount.DismountOffset.X + 0.5f;
87 Vector3 vector = 0.5f * (ComponentCreature.ComponentBody.BoundingBox.Min +
ComponentCreature.ComponentBody.BoundingBox.Max);
102 x = !terrainRaycastResult.HasValue ? 0f - Mount.DismountOffset.X :
103 !terrainRaycastResult2.HasValue ? Mount.DismountOffset.X :
104 !(terrainRaycastResult.Value.Distance > terrainRaycastResult2.
Value.Distance) ?
129 componentBody.ParentBody =
null;
156 || (componentHealth !=
null && componentHealth.
Health <= 0f)
160 ComponentCreature.ComponentBody.ParentBodyPositionOffset = mount.MountOffset +
m_riderOffset;
174 bool modDisallows =
false;
178 modLoader.ScoreMount(
this, componentMount, out
float? scoreByMod);
179 if (scoreByMod.HasValue
183 if (scoreByMod.HasValue) {
184 score =
MathUtils.
Max(score ??
float.MinValue, scoreByMod.Value);
192 if (score.HasValue) {
196 Vector3 v = componentMount.ComponentBody.Position
199 if (v.
Length() < maxDistance) {
202 return maxDistance - v.
Length();
static int Min(int x1, int x2)
static int Max(int x1, int x2)
static float DegToRad(float degrees)
virtual Vector3 ParentBodyPositionOffset
virtual ComponentBody ParentBody
virtual Quaternion ParentBodyRotationOffset
float MountAllowToStartRange
ComponentBody ComponentBody
virtual ComponentMount FindNearestMount()
SubsystemBodies m_subsystemBodies
Vector3 m_targetPositionOffset
ComponentCreature ComponentCreature
float DetectSurroundingMountRange
virtual float ScoreMount(ComponentMount componentMount, float maxDistance)
virtual void StartMounting(ComponentMount componentMount)
DynamicArray< ComponentBody > m_componentBodies
override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
Quaternion m_targetRotationOffset
virtual void StartDismounting()
virtual void Update(float dt)
SubsystemTerrain m_subsystemTerrain
ValuesDictionary ValuesDictionary
Component FindComponent(Type type, string name, bool throwOnError)
static void HookAction(string HookName, Func< ModLoader, bool > action)
执行Hook
static Matrix CreateFromQuaternion(Quaternion quaternion)
static readonly Quaternion Identity
static Quaternion Conjugate(Quaternion q)
static Quaternion Slerp(Quaternion q1, Quaternion q2, float f)
static Quaternion CreateFromAxisAngle(Vector3 axis, float angle)
static float DistanceSquared(Vector3 v1, Vector3 v2)
static Vector3 Lerp(Vector3 v1, Vector3 v2, float f)
static Vector3 Transform(Vector3 v, Matrix m)
static Vector3 Normalize(Vector3 v)
static readonly Vector3 UnitY
static float Dot(Vector3 v1, Vector3 v2)