mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-16 15:22:27 +02:00
* Physics worlds * Paul's a good boy * Build working * Ingame and not lagging to hell * Why didn't you commit ahhhhh * Hard collisions working * Solver parity * Decent broadphase work done * BroadPhase outline done * BroadPhase working * waiting for pvs * Fix static PVS AABB * Stop static bodies from awakening * Optimise a bunch of stuff * Even more broadphase stuff * I'm fucking stupid * Optimise fixture updates * Collision solver start * Building * A is for Argumentative * Fix contact caching island flags * Circle shapes actually workeded * Damping * DS2 consumables only * Slightly more stable * Even slightlier more stablier * VV your heart out * Initial joint support * 90% of joints I just wanted to push as I'd scream if I lost progress * JOINT PURGATORY * Joints barely functional lmao * Okay these joints slightly more functional * Remove station FrictionJoint * Also that * Some Box2D ports * Cleanup mass * Edge shape * Active contacts * Fix active contacts * Optimise active contacts even more * Boxes be stacking * I would die for smug oh my fucking god * In which everything is fixed * Distance joints working LETS GO * Remove frequency on distancejoint * Fix some stuff and break joints * Crashing fixed mehbeh * ICollideSpecial and more resilience * auto-clear * showbb vera * Slap that TODO in there * Fix restartround crash * Random fixes * Fix fixture networking * Add intersection method for broadphase * Fix contacts * Licenses done * Optimisations * Fix wall clips * Config caching for island * allocations optimisations * Optimise casts * Optimise events queue for physics * Contact manager optimisations * Optimise controllers * Sloth joint or something idk * Controller graph * Remove content cvar * Random cleanup * Finally remove VirtualController * Manifold structs again * Optimise this absolute retardation * Optimise * fix license * Cleanup physics interface * AHHHHHHHHHHHHH * Fix collisions again * snivybus * Fix potential nasty manifold bug * Tests go snivy * Disable prediction for now * Spans * Fix ShapeTypes * fixes * ch ch changeesss * Kinematic idea * Prevent static bodies from waking * Pass WorldAABB to MoveEvent * Fix collisions * manifold structs fucking WOOORRKKKINNGGG * Better pushing * Fix merge ickies * Optimise MoveEvents * Use event for collisions performance * Fix content tests * Do not research tests * Fix most conflicts * Paul's trying to kill me * Maybe collisions work idk * Make us whole again * Smug is also trying to kill me * nani * shitty collisions * Settling * Do not research collisions * SHIP IT * Fix joints * PVS moment * Fix other assert * Fix locker collisions * serializable sleeptime * Aether2D contacts * Physics is no longer crashing (and burning) * Add to the TODO list Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
69 lines
2.4 KiB
C#
69 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Robust.Shared.Maths;
|
|
using Robust.Shared.Physics;
|
|
using Robust.Shared.Physics.Dynamics;
|
|
using Robust.Shared.Physics.Dynamics.Joints;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Robust.Shared.GameObjects
|
|
{
|
|
[Serializable, NetSerializable]
|
|
public class PhysicsComponentState : ComponentState
|
|
{
|
|
public readonly bool CanCollide;
|
|
public readonly bool SleepingAllowed;
|
|
public readonly bool FixedRotation;
|
|
public readonly BodyStatus Status;
|
|
public readonly List<Fixture> Fixtures;
|
|
public readonly List<Joint> Joints;
|
|
|
|
/// <summary>
|
|
/// Current mass of the entity, stored in grams.
|
|
/// </summary>
|
|
public readonly int Mass;
|
|
public readonly Vector2 LinearVelocity;
|
|
public readonly float AngularVelocity;
|
|
public readonly BodyType BodyType;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="canCollide"></param>
|
|
/// <param name="sleepingAllowed"></param>
|
|
/// <param name="fixedRotation"></param>
|
|
/// <param name="status"></param>
|
|
/// <param name="fixtures"></param>
|
|
/// <param name="joints"></param>
|
|
/// <param name="mass">Current Mass of the entity.</param>
|
|
/// <param name="linearVelocity">Current linear velocity of the entity in meters per second.</param>
|
|
/// <param name="angularVelocity">Current angular velocity of the entity in radians per sec.</param>
|
|
/// <param name="bodyType"></param>
|
|
public PhysicsComponentState(
|
|
bool canCollide,
|
|
bool sleepingAllowed,
|
|
bool fixedRotation,
|
|
BodyStatus status,
|
|
List<Fixture> fixtures,
|
|
List<Joint> joints,
|
|
float mass,
|
|
Vector2 linearVelocity,
|
|
float angularVelocity,
|
|
BodyType bodyType)
|
|
: base(NetIDs.PHYSICS)
|
|
{
|
|
CanCollide = canCollide;
|
|
SleepingAllowed = sleepingAllowed;
|
|
FixedRotation = fixedRotation;
|
|
Status = status;
|
|
Fixtures = fixtures;
|
|
Joints = joints;
|
|
|
|
LinearVelocity = linearVelocity;
|
|
AngularVelocity = angularVelocity;
|
|
Mass = (int) Math.Round(mass * 1000); // rounds kg to nearest gram
|
|
BodyType = bodyType;
|
|
}
|
|
}
|
|
}
|