Skip to content

Commit

Permalink
ran formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
azaleacolburn committed Jun 26, 2024
1 parent 2d6698f commit 014dcb0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
9 changes: 4 additions & 5 deletions fission/src/systems/physics/PhysicsSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const SIMULATION_PERIOD = 1.0 / 120.0
const STANDARD_SUB_STEPS = 3

// Friction constants
const FLOOR_FRICTION = 0.7;
const SUSPENSION_MIN_FACTOR = 0.1;
const SUSPENSION_MAX_FACTOR = 0.3;
const FLOOR_FRICTION = 0.7
const SUSPENSION_MIN_FACTOR = 0.1
const SUSPENSION_MAX_FACTOR = 0.3

/**
* The PhysicsSystem handles all Jolt Phyiscs interactions within Synthesis.
Expand Down Expand Up @@ -77,10 +77,9 @@ class PhysicsSystem extends WorldSystem {
new THREE.Vector3(0.0, -2.0, 0.0),
undefined
)
ground.SetFriction(FLOOR_FRICTION);
ground.SetFriction(FLOOR_FRICTION)
this._joltBodyInterface.AddBody(ground.GetID(), JOLT.EActivation_Activate)
}


/**
* TEMPORARY
Expand Down
20 changes: 11 additions & 9 deletions fission/src/systems/simulation/driver/WheelDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import Jolt from "@barclah/jolt-physics"
import Driver from "./Driver"
import JOLT from "@/util/loading/JoltSyncLoader"

const LATERIAL_FRICTION = 0.6;
const LONGITUDINAL_FRICTION = 0.8;
const LATERIAL_FRICTION = 0.6
const LONGITUDINAL_FRICTION = 0.8

class WheelDriver extends Driver {
private _constraint: Jolt.VehicleConstraint
Expand All @@ -18,19 +18,21 @@ class WheelDriver extends Driver {
this._targetWheelSpeed = radsPerSec
}

public get constraint(): Jolt.VehicleConstraint { return this._constraint }
public get constraint(): Jolt.VehicleConstraint {
return this._constraint
}

public constructor(constraint: Jolt.VehicleConstraint) {
super()

this._constraint = constraint;
this._wheel = JOLT.castObject(this._constraint.GetWheel(0), JOLT.WheelWV);
this._wheel.set_mCombinedLateralFriction(LATERIAL_FRICTION);
this._wheel.set_mCombinedLongitudinalFriction(LONGITUDINAL_FRICTION);
this._constraint = constraint
this._wheel = JOLT.castObject(this._constraint.GetWheel(0), JOLT.WheelWV)
this._wheel.set_mCombinedLateralFriction(LATERIAL_FRICTION)
this._wheel.set_mCombinedLongitudinalFriction(LONGITUDINAL_FRICTION)
}

public Update(_: number): void {
this._wheel.SetAngularVelocity(this._targetWheelSpeed);
public Update(_: number): void {
this._wheel.SetAngularVelocity(this._targetWheelSpeed)
}
}

Expand Down

0 comments on commit 014dcb0

Please sign in to comment.