Selaa lähdekoodia

Spelling and typographical errors (#1399)

Stephen Gold 10 kuukautta sitten
vanhempi
commit
7839a60dd0

+ 1 - 1
Jolt/Geometry/Ellipse.h

@@ -38,7 +38,7 @@ public:
 		// <=> (x', y') = (a^2 x / (t + a^2), b^2 y / (t + b^2))
 		// Requiring point to be on ellipse (substituting into [1]): g(t) = (a x / (t + a^2))^2 + (b y / (t + b^2))^2 - 1 = 0
 
-		// Newton raphson iteration, starting at t = 0
+		// Newton Raphson iteration, starting at t = 0
 		float t = 0.0f;
 		for (;;)
 		{

+ 4 - 4
Jolt/Geometry/RayAABox.h

@@ -36,7 +36,7 @@ JPH_INLINE float RayAABox(Vec3Arg inOrigin, const RayInvDirection &inInvDirectio
 	Vec3 flt_min = Vec3::sReplicate(-FLT_MAX);
 	Vec3 flt_max = Vec3::sReplicate(FLT_MAX);
 
-	// Test against all three axii simultaneously.
+	// Test against all three axes simultaneously.
 	Vec3 t1 = (inBoundsMin - inOrigin) * inInvDirection.mInvDirection;
 	Vec3 t2 = (inBoundsMax - inOrigin) * inInvDirection.mInvDirection;
 
@@ -90,7 +90,7 @@ JPH_INLINE Vec4 RayAABox4(Vec3Arg inOrigin, const RayInvDirection &inInvDirectio
 	Vec4 invdiry = inInvDirection.mInvDirection.SplatY();
 	Vec4 invdirz = inInvDirection.mInvDirection.SplatZ();
 
-	// Test against all three axii simultaneously.
+	// Test against all three axes simultaneously.
 	Vec4 t1x = (inBoundsMinX - originx) * invdirx;
 	Vec4 t1y = (inBoundsMinY - originy) * invdiry;
 	Vec4 t1z = (inBoundsMinZ - originz) * invdirz;
@@ -139,7 +139,7 @@ JPH_INLINE void RayAABox(Vec3Arg inOrigin, const RayInvDirection &inInvDirection
 	Vec3 flt_min = Vec3::sReplicate(-FLT_MAX);
 	Vec3 flt_max = Vec3::sReplicate(FLT_MAX);
 
-	// Test against all three axii simultaneously.
+	// Test against all three axes simultaneously.
 	Vec3 t1 = (inBoundsMin - inOrigin) * inInvDirection.mInvDirection;
 	Vec3 t2 = (inBoundsMax - inOrigin) * inInvDirection.mInvDirection;
 
@@ -178,7 +178,7 @@ JPH_INLINE bool RayAABoxHits(Vec3Arg inOrigin, const RayInvDirection &inInvDirec
 	Vec3 flt_min = Vec3::sReplicate(-FLT_MAX);
 	Vec3 flt_max = Vec3::sReplicate(FLT_MAX);
 
-	// Test against all three axii simultaneously.
+	// Test against all three axes simultaneously.
 	Vec3 t1 = (inBoundsMin - inOrigin) * inInvDirection.mInvDirection;
 	Vec3 t2 = (inBoundsMax - inOrigin) * inInvDirection.mInvDirection;
 

+ 3 - 3
Jolt/Math/EigenValueSymmetric.h

@@ -11,7 +11,7 @@ JPH_NAMESPACE_BEGIN
 /// Function to determine the eigen vectors and values of a N x N real symmetric matrix
 /// by Jacobi transformations. This method is most suitable for N < 10.
 ///
-/// Taken and adapted from Numerical Recipies paragraph 11.1
+/// Taken and adapted from Numerical Recipes paragraph 11.1
 ///
 /// An eigen vector is a vector v for which \f$A \: v = \lambda \: v\f$
 ///
@@ -95,7 +95,7 @@ bool EigenValueSymmetric(const Matrix &inMatrix, Matrix &outEigVec, Vector &outE
 
 		// On the first three sweeps use a fraction of the sum of the off diagonal elements as threshold
 		// Note that we pick a minimum threshold of FLT_MIN because dividing by a denormalized number is likely to result in infinity.
-		float tresh = sweep < 4? 0.2f * avg_sm : FLT_MIN; // Original code: 0.0f instead of FLT_MIN
+		float thresh = sweep < 4? 0.2f * avg_sm : FLT_MIN; // Original code: 0.0f instead of FLT_MIN
 
 		for (uint ip = 0; ip < n - 1; ++ip)
 			for (uint iq = ip + 1; iq < n; ++iq)
@@ -114,7 +114,7 @@ bool EigenValueSymmetric(const Matrix &inMatrix, Matrix &outEigVec, Vector &outE
 				{
 					a_pq = 0.0f;
 				}
-				else if (abs_a_pq > tresh)
+				else if (abs_a_pq > thresh)
 				{
 					float h = eigval_q - eigval_p;
 					float abs_h = abs(h);

+ 1 - 1
Jolt/Math/GaussianElimination.h

@@ -14,7 +14,7 @@ JPH_NAMESPACE_BEGIN
 /// Set A to the matrix to invert, set B to identity and let GaussianElimination solve
 /// the equation, on return B will be the inverse of A. And A is destroyed.
 ///
-/// Taken and adapted from Numerical Recipies in C paragraph 2.1
+/// Taken and adapted from Numerical Recipes in C paragraph 2.1
 template <class MatrixA, class MatrixB>
 bool GaussianElimination(MatrixA &ioA, MatrixB &ioB, float inTolerance = 1.0e-16f)
 {

+ 1 - 1
Jolt/Physics/Body/MotionQuality.h

@@ -9,7 +9,7 @@ JPH_NAMESPACE_BEGIN
 /// Motion quality, or how well it detects collisions when it has a high velocity
 enum class EMotionQuality : uint8
 {
-	/// Update the body in discrete steps. Body will tunnel throuh thin objects if its velocity is high enough.
+	/// Update the body in discrete steps. Body will tunnel through thin objects if its velocity is high enough.
 	/// This is the cheapest way of simulating a body.
 	Discrete,
 

+ 1 - 1
Jolt/Physics/Character/Character.h

@@ -92,7 +92,7 @@ public:
 	RVec3								GetPosition(bool inLockBodies = true) const;
 
 	/// Set the position of the character, optionally activating it.
-	void								SetPosition(RVec3Arg inPostion, EActivation inActivationMode = EActivation::Activate, bool inLockBodies = true);
+	void								SetPosition(RVec3Arg inPosition, EActivation inActivationMode = EActivation::Activate, bool inLockBodies = true);
 
 	/// Get the rotation of the character
 	Quat								GetRotation(bool inLockBodies = true) const;

+ 1 - 1
Jolt/Physics/Collision/BroadPhase/BroadPhase.h

@@ -75,7 +75,7 @@ public:
 	virtual void		RemoveBodies(BodyID *ioBodies, int inNumber) = 0;
 
 	/// Call whenever the aabb of a body changes (can change order of ioBodies array)
-	/// inTakeLock should be false if we're between LockModifications/UnlockModificiations in which case care needs to be taken to not call this between UpdatePrepare/UpdateFinalize
+	/// inTakeLock should be false if we're between LockModifications/UnlockModifications, in which case care needs to be taken to not call this between UpdatePrepare/UpdateFinalize
 	virtual void		NotifyBodiesAABBChanged(BodyID *ioBodies, int inNumber, bool inTakeLock = true) = 0;
 
 	/// Call whenever the layer (and optionally the aabb as well) of a body changes (can change order of ioBodies array)

+ 1 - 1
Jolt/Physics/Collision/BroadPhase/BroadPhaseQuadTree.cpp

@@ -350,7 +350,7 @@ void BroadPhaseQuadTree::NotifyBodiesAABBChanged(BodyID *ioBodies, int inNumber,
 		// Find first body with different layer
 		BodyID *b_mid = std::upper_bound(b_start, b_end, broadphase_layer, [tracking](BroadPhaseLayer::Type inLayer, BodyID inBodyID) { return inLayer < tracking[inBodyID.GetIndex()].mBroadPhaseLayer; });
 
-		// Nodify all bodies of the same layer changed
+		// Notify all bodies of the same layer changed
 		mLayers[broadphase_layer].NotifyBodiesAABBChanged(bodies, mTracking, b_start, int(b_mid - b_start));
 
 		// Repeat

+ 1 - 1
Jolt/Physics/Collision/BroadPhase/QuadTree.cpp

@@ -702,7 +702,7 @@ void QuadTree::WidenAndMarkNodeAndParentsChanged(uint32 inNodeIndex, const AABox
 
 bool QuadTree::TryInsertLeaf(TrackingVector &ioTracking, int inNodeIndex, NodeID inLeafID, const AABox &inLeafBounds, int inLeafNumBodies)
 {
-	// Tentively assign the node as parent
+	// Tentatively assign the node as parent
 	bool leaf_is_node = inLeafID.IsNode();
 	if (leaf_is_node)
 	{

+ 1 - 1
Jolt/Physics/Collision/CastSphereVsTriangles.cpp

@@ -104,7 +104,7 @@ float CastSphereVsTriangles::RayCylinder(Vec3Arg inRayDirection, Vec3Arg inCylin
 	float c = axis_len_sq * (start.LengthSq() - Square(inRadius)) - Square(start_dot_axis);
 	float det = Square(b) - a * c; // normally 4 * a * c but since both a and c need to be divided by 2 we lose the 4
 	if (det < 0.0f)
-		return FLT_MAX; // No solution to quadractic equation
+		return FLT_MAX; // No solution to quadratic equation
 
 	// Solve fraction t where the ray hits the cylinder
 	float t = -(b + sqrt(det)) / a; // normally divided by 2 * a but since a should be divided by 2 we lose the 2

+ 1 - 1
Jolt/Physics/Collision/Shape/ConvexHullShape.cpp

@@ -104,7 +104,7 @@ ConvexHullShape::ConvexHullShape(const ConvexHullShapeSettings &inSettings, Shap
 		{
 			Vec3 v3 = inSettings.mPoints[e->mStartIdx] - mCenterOfMass;
 
-			// Affine transform that transforms a unit tetrahedon (with vertices (0, 0, 0), (1, 0, 0), (0, 1, 0) and (0, 0, 1) to this tetrahedron
+			// Affine transform that transforms a unit tetrahedron (with vertices (0, 0, 0), (1, 0, 0), (0, 1, 0) and (0, 0, 1) to this tetrahedron
 			Mat44 a(Vec4(v1, 0), Vec4(v2, 0), Vec4(v3, 0), Vec4(0, 0, 0, 1));
 
 			// Calculate covariance matrix for this tetrahedron

+ 1 - 1
Jolt/Physics/Collision/Shape/Shape.h

@@ -331,7 +331,7 @@ public:
 	/// Collect the leaf transformed shapes of all leaf shapes of this shape.
 	/// inBox is the world space axis aligned box which leaf shapes should collide with.
 	/// inPositionCOM/inRotation/inScale describes the transform of this shape.
-	/// inSubShapeIDCeator represents the current sub shape ID of this shape.
+	/// inSubShapeIDCreator represents the current sub shape ID of this shape.
 	virtual void					CollectTransformedShapes(const AABox &inBox, Vec3Arg inPositionCOM, QuatArg inRotation, Vec3Arg inScale, const SubShapeIDCreator &inSubShapeIDCreator, TransformedShapeCollector &ioCollector, const ShapeFilter &inShapeFilter) const;
 
 	/// Transforms this shape and all of its children with inTransform, resulting shape(s) are passed to ioCollector.

+ 1 - 1
Jolt/Physics/Collision/Shape/TaperedCylinderShape.cpp

@@ -313,7 +313,7 @@ MassProperties TaperedCylinderShape::GetMassProperties() const
 	// Ixx(br,tr,b,t):=integrate(dix(x)+area(x)*x^2,x,b,t)*density(b,t);
 	// Inertia tensor element yy:
 	// Iyy(br,tr,b,t):=integrate(diy(x),x,b,t)*density(b,t);
-	// Note that we can simplfy Ixx by using:
+	// Note that we can simplify Ixx by using:
 	// Ixx_delta(br,tr,b,t):=Ixx(br,tr,b,t)-Iyy(br,tr,b,t)/2;
 	// For a cylinder this formula matches what is listed on the wiki:
 	// factor(Ixx(r,r,-h/2,h/2));

+ 6 - 6
Jolt/Physics/Collision/Shape/TriangleShape.cpp

@@ -91,7 +91,7 @@ class TriangleShape::TriangleNoConvex final : public Support
 {
 public:
 							TriangleNoConvex(Vec3Arg inV1, Vec3Arg inV2, Vec3Arg inV3) :
-		mTriangleSuport(inV1, inV2, inV3)
+		mTriangleSupport(inV1, inV2, inV3)
 	{
 		static_assert(sizeof(TriangleNoConvex) <= sizeof(SupportBuffer), "Buffer size too small");
 		JPH_ASSERT(IsAligned(this, alignof(TriangleNoConvex)));
@@ -99,7 +99,7 @@ public:
 
 	virtual Vec3			GetSupport(Vec3Arg inDirection) const override
 	{
-		return mTriangleSuport.GetSupport(inDirection);
+		return mTriangleSupport.GetSupport(inDirection);
 	}
 
 	virtual float			GetConvexRadius() const override
@@ -108,7 +108,7 @@ public:
 	}
 
 private:
-	TriangleConvexSupport	mTriangleSuport;
+	TriangleConvexSupport	mTriangleSupport;
 };
 
 class TriangleShape::TriangleWithConvex final : public Support
@@ -116,7 +116,7 @@ class TriangleShape::TriangleWithConvex final : public Support
 public:
 							TriangleWithConvex(Vec3Arg inV1, Vec3Arg inV2, Vec3Arg inV3, float inConvexRadius) :
 		mConvexRadius(inConvexRadius),
-		mTriangleSuport(inV1, inV2, inV3)
+		mTriangleSupport(inV1, inV2, inV3)
 	{
 		static_assert(sizeof(TriangleWithConvex) <= sizeof(SupportBuffer), "Buffer size too small");
 		JPH_ASSERT(IsAligned(this, alignof(TriangleWithConvex)));
@@ -124,7 +124,7 @@ public:
 
 	virtual Vec3			GetSupport(Vec3Arg inDirection) const override
 	{
-		Vec3 support = mTriangleSuport.GetSupport(inDirection);
+		Vec3 support = mTriangleSupport.GetSupport(inDirection);
 		float len = inDirection.Length();
 		if (len > 0.0f)
 			support += (mConvexRadius / len) * inDirection;
@@ -138,7 +138,7 @@ public:
 
 private:
 	float					mConvexRadius;
-	TriangleConvexSupport	mTriangleSuport;
+	TriangleConvexSupport	mTriangleSupport;
 };
 
 const ConvexShape::Support *TriangleShape::GetSupportFunction(ESupportMode inMode, SupportBuffer &inBuffer, Vec3Arg inScale) const

+ 1 - 1
Jolt/Physics/Collision/TransformedShape.h

@@ -89,7 +89,7 @@ public:
 	inline Vec3					GetShapeScale() const						{ return Vec3::sLoadFloat3Unsafe(mShapeScale); }
 	inline void					SetShapeScale(Vec3Arg inScale)				{ inScale.StoreFloat3(&mShapeScale); }
 
-	/// Calculates the transform for this shapes's center of mass (excluding scale)
+	/// Calculates the transform for this shape's center of mass (excluding scale)
 	inline RMat44				GetCenterOfMassTransform() const			{ return RMat44::sRotationTranslation(mShapeRotation, mShapePositionCOM); }
 
 	/// Calculates the inverse of the transform for this shape's center of mass (excluding scale)

+ 1 - 1
Jolt/Physics/Constraints/ContactConstraintManager.cpp

@@ -136,7 +136,7 @@ JPH_INLINE void ContactConstraintManager::WorldContactPoint::TemplatedCalculateF
 		float surface_velocity1 = inWorldSpaceTangent1.Dot(ws_surface_velocity);
 		float surface_velocity2 = inWorldSpaceTangent2.Dot(ws_surface_velocity);
 
-		// Implement friction as 2 AxisContraintParts
+		// Implement friction as 2 AxisConstraintParts
 		mFrictionConstraint1.TemplatedCalculateConstraintProperties<Type1, Type2>(inInvM1, inInvI1, r1, inInvM2, inInvI2, r2, inWorldSpaceTangent1, surface_velocity1);
 		mFrictionConstraint2.TemplatedCalculateConstraintProperties<Type1, Type2>(inInvM1, inInvI1, r1, inInvM2, inInvI2, r2, inWorldSpaceTangent2, surface_velocity2);
 	}

+ 2 - 2
Jolt/Physics/PhysicsSystem.cpp

@@ -1443,7 +1443,7 @@ void PhysicsSystem::JobSolveVelocityConstraints(PhysicsUpdateContext *ioContext,
 		}
 		else if (check_split_islands)
 		{
-			// If there are split islands, but we did't do any work, give up a time slice
+			// If there are split islands, but we didn't do any work, give up a time slice
 			std::this_thread::yield();
 		}
 		else
@@ -2462,7 +2462,7 @@ void PhysicsSystem::JobSolvePositionConstraints(PhysicsUpdateContext *ioContext,
 		}
 		else if (check_split_islands)
 		{
-			// If there are split islands, but we did't do any work, give up a time slice
+			// If there are split islands, but we didn't do any work, give up a time slice
 			std::this_thread::yield();
 		}
 		else

+ 1 - 1
Jolt/Physics/PhysicsSystem.h

@@ -65,7 +65,7 @@ public:
 
 	/// Set the function that combines the restitution of two bodies and returns it
 	/// Default method is max(restitution1, restitution1)
-	void						SetCombineRestitution(ContactConstraintManager::CombineFunction inCombineRestition) { mContactManager.SetCombineRestitution(inCombineRestition); }
+	void						SetCombineRestitution(ContactConstraintManager::CombineFunction inCombineRestitution) { mContactManager.SetCombineRestitution(inCombineRestitution); }
 	ContactConstraintManager::CombineFunction GetCombineRestitution() const					{ return mContactManager.GetCombineRestitution(); }
 
 	/// Set/get the shape filter that will be used during simulation. This can be used to exclude shapes within a body from colliding with each other.

+ 3 - 3
Jolt/Physics/SoftBody/SoftBodyMotionProperties.cpp

@@ -599,7 +599,7 @@ void SoftBodyMotionProperties::ApplyCollisionConstraintsAndUpdateVelocities(cons
 	JPH_PROFILE_FUNCTION();
 
 	float dt = inContext.mSubStepDeltaTime;
-	float restitution_treshold = -2.0f * inContext.mGravity.Length() * dt;
+	float restitution_threshold = -2.0f * inContext.mGravity.Length() * dt;
 	float vertex_radius = mSettings->mVertexRadius;
 	for (Vertex &v : mVertices)
 		if (v.mInvMass > 0.0f)
@@ -674,7 +674,7 @@ void SoftBodyMotionProperties::ApplyCollisionConstraintsAndUpdateVelocities(cons
 							// Calculate delta relative velocity due to restitution (equation 35)
 							dv += v_normal;
 							float prev_v_normal = (prev_v - v2).Dot(contact_normal);
-							if (prev_v_normal < restitution_treshold)
+							if (prev_v_normal < restitution_threshold)
 								dv += cs.mRestitution * prev_v_normal * contact_normal;
 
 							// Calculate impulse
@@ -707,7 +707,7 @@ void SoftBodyMotionProperties::ApplyCollisionConstraintsAndUpdateVelocities(cons
 						// Apply restitution (equation 35)
 						v.mVelocity -= v_normal;
 						float prev_v_normal = prev_v.Dot(contact_normal);
-						if (prev_v_normal < restitution_treshold)
+						if (prev_v_normal < restitution_threshold)
 							v.mVelocity -= cs.mRestitution * prev_v_normal * contact_normal;
 					}
 				}

+ 1 - 1
Jolt/Physics/SoftBody/SoftBodyMotionProperties.h

@@ -125,7 +125,7 @@ public:
 	/// This function allows you to update the soft body immediately without going through the PhysicsSystem.
 	/// This is useful if the soft body is teleported and needs to 'settle' or it can be used if a the soft body
 	/// is not added to the PhysicsSystem and needs to be updated manually. One reason for not adding it to the
-	/// PhyicsSystem is that you might want to update a soft body immediately after updating an animated object
+	/// PhysicsSystem is that you might want to update a soft body immediately after updating an animated object
 	/// that has the soft body attached to it. If the soft body is added to the PhysicsSystem it will be updated
 	/// by it, so calling this function will effectively update it twice. Note that when you use this function,
 	/// only the current thread will be used, whereas if you update through the PhysicsSystem, multiple threads may

+ 1 - 1
Jolt/Physics/SoftBody/SoftBodySharedSettings.h

@@ -204,7 +204,7 @@ public:
 		/// Return the lowest vertex index of this constraint
 		uint32			GetMinVertexIndex() const					{ return min(min(mVertex[0], mVertex[1]), min(mVertex[2], mVertex[3])); }
 
-		uint32			mVertex[4];									///< Indices of the vertices that form the tetrhedron
+		uint32			mVertex[4];									///< Indices of the vertices that form the tetrahedron
 		float			mSixRestVolume = 1.0f;						///< 6 times the rest volume of the tetrahedron (calculated by CalculateVolumeConstraintVolumes())
 		float			mCompliance = 0.0f;							///< Inverse of the stiffness of the constraint
 	};

+ 1 - 1
Jolt/Physics/Vehicle/TrackedVehicleController.h

@@ -25,7 +25,7 @@ public:
 	virtual void				RestoreBinaryState(StreamIn &inStream) override;
 
 	float						mLongitudinalFriction = 4.0f;				///< Friction in forward direction of tire
-	float						mLateralFriction = 2.0f;					///< Friction in sideway direction of tire
+	float						mLateralFriction = 2.0f;					///< Friction in sideways direction of tire
 };
 
 /// Wheel object specifically for TrackedVehicleController

+ 1 - 1
Samples/Tests/BroadPhase/BroadPhaseTest.cpp

@@ -57,7 +57,7 @@ void BroadPhaseTest::Initialize()
 	mBodyManager = new BodyManager();
 	mBodyManager->Init(NUM_BODIES, 0, mBroadPhaseLayerInterface);
 
-	// Crate broadphase
+	// Create broadphase
 	mBroadPhase = new BROAD_PHASE;
 	mBroadPhase->Init(mBodyManager, mBroadPhaseLayerInterface);
 }