Format more engine code
This commit is contained in:
@@ -11,14 +11,12 @@
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API BoxCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(BoxCollider);
|
||||
DECLARE_SCENE_OBJECT(BoxCollider);
|
||||
private:
|
||||
|
||||
Float3 _size;
|
||||
OrientedBoundingBox _bounds;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the box, measured in the object's local space.
|
||||
/// </summary>
|
||||
@@ -48,7 +46,6 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
// [Collider]
|
||||
#if USE_EDITOR
|
||||
void OnDebugDraw() override;
|
||||
@@ -59,7 +56,6 @@ public:
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
|
||||
protected:
|
||||
|
||||
// [Collider]
|
||||
void UpdateBounds() override;
|
||||
void GetGeometry(CollisionShape& collision) override;
|
||||
|
||||
@@ -14,15 +14,13 @@
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API CapsuleCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(CapsuleCollider);
|
||||
DECLARE_SCENE_OBJECT(CapsuleCollider);
|
||||
private:
|
||||
|
||||
float _radius;
|
||||
float _height;
|
||||
OrientedBoundingBox _orientedBox;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the radius of the sphere, measured in the object's local space.
|
||||
/// </summary>
|
||||
@@ -64,7 +62,6 @@ public:
|
||||
API_PROPERTY() void SetHeight(float value);
|
||||
|
||||
public:
|
||||
|
||||
// [Collider]
|
||||
#if USE_EDITOR
|
||||
void OnDebugDrawSelected() override;
|
||||
@@ -74,7 +71,6 @@ public:
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
|
||||
protected:
|
||||
|
||||
// [Collider]
|
||||
void UpdateBounds() override;
|
||||
void GetGeometry(CollisionShape& collision) override;
|
||||
|
||||
@@ -11,9 +11,8 @@
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API CharacterController : public Collider, public IPhysicsActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(CharacterController);
|
||||
DECLARE_SCENE_OBJECT(CharacterController);
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Specifies which sides a character is colliding with.
|
||||
/// </summary>
|
||||
@@ -57,7 +56,6 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
void* _controller;
|
||||
float _stepOffset;
|
||||
float _slopeLimit;
|
||||
@@ -148,7 +146,6 @@ public:
|
||||
API_PROPERTY() void SetMinMoveDistance(float value);
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the linear velocity of the Character Controller. This allows tracking how fast the character is actually moving, for instance when it is stuck at a wall this value will be the near zero vector.
|
||||
/// </summary>
|
||||
@@ -165,7 +162,6 @@ public:
|
||||
API_PROPERTY() CollisionFlags GetFlags() const;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Moves the character with the given speed. Gravity is automatically applied. It will slide along colliders. Result collision flags is the summary of collisions that occurred during the Move.
|
||||
/// </summary>
|
||||
@@ -181,7 +177,6 @@ public:
|
||||
API_FUNCTION() CollisionFlags Move(const Vector3& displacement);
|
||||
|
||||
protected:
|
||||
|
||||
/// <summary>
|
||||
/// Creates the physics actor.
|
||||
/// </summary>
|
||||
@@ -198,7 +193,6 @@ protected:
|
||||
void UpdateSize() const;
|
||||
|
||||
public:
|
||||
|
||||
// [Collider]
|
||||
#if USE_EDITOR
|
||||
void OnDebugDrawSelected() override;
|
||||
@@ -216,7 +210,6 @@ public:
|
||||
void* GetPhysicsActor() const override;
|
||||
|
||||
protected:
|
||||
|
||||
// [PhysicsActor]
|
||||
void UpdateGeometry() override;
|
||||
void GetGeometry(CollisionShape& collision) override;
|
||||
|
||||
@@ -17,9 +17,8 @@ class RigidBody;
|
||||
/// <seealso cref="PhysicsColliderActor" />
|
||||
API_CLASS(Abstract) class FLAXENGINE_API Collider : public PhysicsColliderActor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT_ABSTRACT(Collider);
|
||||
DECLARE_SCENE_OBJECT_ABSTRACT(Collider);
|
||||
protected:
|
||||
|
||||
Vector3 _center;
|
||||
bool _isTrigger;
|
||||
void* _shape;
|
||||
@@ -30,7 +29,6 @@ protected:
|
||||
Quaternion _cachedLocalPoseRot;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the native physics backend object.
|
||||
/// </summary>
|
||||
@@ -97,7 +95,6 @@ public:
|
||||
AssetReference<JsonAsset> Material;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Performs a raycast against this collider shape.
|
||||
/// </summary>
|
||||
@@ -146,7 +143,6 @@ public:
|
||||
API_FUNCTION() static bool ComputePenetration(const Collider* colliderA, const Collider* colliderB, API_PARAM(Out) Vector3& direction, API_PARAM(Out) float& distance);
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether this collider can be attached the specified rigid body.
|
||||
/// </summary>
|
||||
@@ -167,7 +163,6 @@ public:
|
||||
void Attach(RigidBody* rigidBody);
|
||||
|
||||
protected:
|
||||
|
||||
/// <summary>
|
||||
/// Updates the shape actor collisions/queries layer mask bits.
|
||||
/// </summary>
|
||||
@@ -209,18 +204,15 @@ protected:
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
void OnMaterialChanged();
|
||||
|
||||
public:
|
||||
|
||||
// [PhysicsColliderActor]
|
||||
void Serialize(SerializeStream& stream, const void* otherObj) override;
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
RigidBody* GetAttachedRigidBody() const override;
|
||||
|
||||
protected:
|
||||
|
||||
// [PhysicsColliderActor]
|
||||
#if USE_EDITOR
|
||||
void OnEnable() override;
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API MeshCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(MeshCollider);
|
||||
DECLARE_SCENE_OBJECT(MeshCollider);
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Linked collision data asset that contains convex mesh or triangle mesh used to represent a mesh collider shape.
|
||||
/// </summary>
|
||||
@@ -22,12 +21,10 @@ public:
|
||||
AssetReference<CollisionData> CollisionData;
|
||||
|
||||
private:
|
||||
|
||||
void OnCollisionDataChanged();
|
||||
void OnCollisionDataLoaded();
|
||||
|
||||
public:
|
||||
|
||||
// [Collider]
|
||||
bool CanAttach(RigidBody* rigidBody) const override;
|
||||
bool CanBeTrigger() const override;
|
||||
@@ -39,7 +36,6 @@ public:
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
|
||||
protected:
|
||||
|
||||
// [Collider]
|
||||
#if USE_EDITOR
|
||||
void DrawPhysicsDebug(RenderView& view) override;
|
||||
|
||||
@@ -10,13 +10,11 @@
|
||||
/// <seealso cref="Collider" />
|
||||
API_CLASS() class FLAXENGINE_API SphereCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SphereCollider);
|
||||
DECLARE_SCENE_OBJECT(SphereCollider);
|
||||
private:
|
||||
|
||||
float _radius;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Gets the radius of the sphere, measured in the object's local space.
|
||||
/// </summary>
|
||||
@@ -38,7 +36,6 @@ public:
|
||||
API_PROPERTY() void SetRadius(float value);
|
||||
|
||||
public:
|
||||
|
||||
// [Collider]
|
||||
#if USE_EDITOR
|
||||
void OnDebugDrawSelected() override;
|
||||
@@ -48,7 +45,6 @@ public:
|
||||
void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override;
|
||||
|
||||
protected:
|
||||
|
||||
// [Collider]
|
||||
#if USE_EDITOR
|
||||
void DrawPhysicsDebug(RenderView& view) override;
|
||||
|
||||
@@ -15,7 +15,7 @@ class Spline;
|
||||
/// <seealso cref="Spline" />
|
||||
API_CLASS() class FLAXENGINE_API SplineCollider : public Collider
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(SplineCollider);
|
||||
DECLARE_SCENE_OBJECT(SplineCollider);
|
||||
private:
|
||||
Spline* _spline = nullptr;
|
||||
void* _triangleMesh = nullptr;
|
||||
@@ -24,7 +24,6 @@ private:
|
||||
Transform _preTransform = Transform::Identity;
|
||||
|
||||
public:
|
||||
|
||||
/// <summary>
|
||||
/// Linked collision data asset that contains convex mesh or triangle mesh used to represent a spline collider shape.
|
||||
/// </summary>
|
||||
@@ -50,13 +49,11 @@ public:
|
||||
void ExtractGeometry(Array<Float3>& vertexBuffer, Array<int32>& indexBuffer) const;
|
||||
|
||||
private:
|
||||
|
||||
void OnCollisionDataChanged();
|
||||
void OnCollisionDataLoaded();
|
||||
void OnSplineUpdated();
|
||||
|
||||
public:
|
||||
|
||||
// [Collider]
|
||||
bool CanAttach(RigidBody* rigidBody) const override;
|
||||
bool CanBeTrigger() const override;
|
||||
@@ -70,7 +67,6 @@ public:
|
||||
void EndPlay() override;
|
||||
|
||||
protected:
|
||||
|
||||
// [Collider]
|
||||
#if USE_EDITOR
|
||||
void DrawPhysicsDebug(RenderView& view) override;
|
||||
|
||||
Reference in New Issue
Block a user