MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / MovementParameters

Method MovementParameters

source/game/StarMovementController.cpp:15–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15MovementParameters::MovementParameters(Json const& config) {
16 if (config.isNull())
17 return;
18
19 mass = config.optFloat("mass");
20 gravityMultiplier = config.optFloat("gravityMultiplier");
21 liquidBuoyancy = config.optFloat("liquidBuoyancy");
22 airBuoyancy = config.optFloat("airBuoyancy");
23 bounceFactor = config.optFloat("bounceFactor");
24 stopOnFirstBounce = config.optBool("stopOnFirstBounce");
25 enableSurfaceSlopeCorrection = config.optBool("enableSurfaceSlopeCorrection");
26 slopeSlidingFactor = config.optFloat("slopeSlidingFactor");
27 maxMovementPerStep = config.optFloat("maxMovementPerStep");
28 maximumCorrection = config.optFloat("maximumCorrection");
29 speedLimit = config.optFloat("speedLimit");
30 discontinuityThreshold = config.optFloat("discontinuityThreshold");
31 collisionPoly = config.opt("collisionPoly").apply(jsonToPolyF);
32 stickyCollision = config.optBool("stickyCollision");
33 stickyForce = config.optFloat("stickyForce");
34 airFriction = config.optFloat("airFriction");
35 liquidFriction = config.optFloat("liquidFriction");
36 groundFriction = config.optFloat("groundFriction");
37 collisionEnabled = config.optBool("collisionEnabled");
38 frictionEnabled = config.optBool("frictionEnabled");
39 gravityEnabled = config.optBool("gravityEnabled");
40 ignorePlatformCollision = config.optBool("ignorePlatformCollision");
41 maximumPlatformCorrection = config.optFloat("maximumPlatformCorrection");
42 maximumPlatformCorrectionVelocityFactor = config.optFloat("maximumPlatformCorrectionVelocityFactor");
43 physicsEffectCategories = config.opt("physicsEffectCategories").apply(jsonToStringSet);
44 restDuration = config.optInt("restDuration");
45}
46
47MovementParameters MovementParameters::merge(MovementParameters const& rhs) const {
48 MovementParameters merged;

Callers

nothing calls this directly

Calls 6

optFloatMethod · 0.80
optBoolMethod · 0.80
optIntMethod · 0.80
isNullMethod · 0.45
applyMethod · 0.45
optMethod · 0.45

Tested by

no test coverage detected