Skip to content

Default inertia #558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions src/simulator/definitions/nodes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ import { BB2025Templates, BB2025Geometries } from "./2025gameTableTemplates";

// TODO: Consider deep-freezing all of these objects

const CAN_PHYSICS: Node.Physics = {
type: 'cylinder',
mass: Mass.grams(5),
friction: 10,
restitution: 0.4,
inertia: [20, 20, 20],
};

const canTemplate: Node.TemplatedNode<Node.Obj> = {
type: 'object',
geometryId: 'can',
physics: {
type: 'cylinder',
mass: Mass.grams(5),
friction: 0.7,
restitution: 0.3,
inertia: [1, 1, 1],
},
physics: CAN_PHYSICS,
material: {
type: 'basic',
color: {
Expand All @@ -46,12 +48,7 @@ const circleTemplate: Node.TemplatedNode<Node.Obj> = {
const lifescienceTemplate: Node.TemplatedNode<Node.Obj> = {
type: 'object',
geometryId: 'can',
physics: {
type: 'cylinder',
mass: Mass.grams(5),
friction: 0.7,
restitution: 0.3,
},
physics: CAN_PHYSICS,
material: {
type: 'basic',
color: {
Expand All @@ -65,12 +62,7 @@ const lifescienceTemplate: Node.TemplatedNode<Node.Obj> = {
const radscienceTemplate: Node.TemplatedNode<Node.Obj> = {
type: 'object',
geometryId: 'can',
physics: {
type: 'cylinder',
mass: Mass.grams(5),
friction: 0.7,
restitution: 0.3,
},
physics: CAN_PHYSICS,
material: {
type: 'basic',
color: {
Expand All @@ -84,12 +76,7 @@ const radscienceTemplate: Node.TemplatedNode<Node.Obj> = {
const noradscienceTemplate: Node.TemplatedNode<Node.Obj> = {
type: 'object',
geometryId: 'can',
physics: {
type: 'cylinder',
mass: Mass.grams(5),
friction: 0.7,
restitution: 0.3,
},
physics: CAN_PHYSICS,
material: {
type: 'basic',
color: {
Expand All @@ -107,7 +94,8 @@ const reamTemplate: Node.TemplatedNode<Node.Obj> = {
type: 'box',
restitution: .3,
friction: 1,
mass: Mass.pounds(5),
mass: Mass.pounds(10),
inertia: [50, 50, 50],
},
material: {
type: 'basic',
Expand Down Expand Up @@ -158,6 +146,7 @@ const sciencePadTemplate: Node.TemplatedNode<Node.Obj> = {
type: 'object',
geometryId: 'sciencepad',
physics: {
motionType: PhysicsMotionType.STATIC,
type: 'box',
restitution: 1,
friction: 1,
Expand All @@ -179,6 +168,7 @@ const basaltTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.grams(20),
inertia: [1, 1, 1],
},
material: {
type: 'basic',
Expand All @@ -197,6 +187,7 @@ const anorthositeTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.grams(20),
inertia: [1, 1, 1],
},
material: {
type: 'basic',
Expand All @@ -215,6 +206,7 @@ const brecciaTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.grams(20),
inertia: [1, 1, 1],
},
material: {
type: 'basic',
Expand All @@ -233,6 +225,7 @@ const meteoriteTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.grams(20),
inertia: [1, 1, 1],
},
material: {
type: 'basic',
Expand All @@ -247,6 +240,7 @@ const containerTemplate: Node.TemplatedNode<Node.Obj> = {
type: 'object',
geometryId: 'container',
physics: {
motionType: PhysicsMotionType.STATIC,
type: 'mesh',
restitution: .3,
friction: 1,
Expand All @@ -261,6 +255,7 @@ const botguyTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.grams(5),
inertia: [1, 1, 1],
},
};
const solarpanelTemplate: Node.TemplatedNode<Node.Obj> = {
Expand All @@ -271,6 +266,7 @@ const solarpanelTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.pounds(.3),
inertia: [1, 1, 1],
},
};

Expand All @@ -282,6 +278,7 @@ const walkwayTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.pounds(.3),
inertia: [1, 1, 1],
},
};
const commstowerTemplate: Node.TemplatedNode<Node.Obj> = {
Expand All @@ -292,6 +289,7 @@ const commstowerTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.pounds(.3),
inertia: [1, 1, 1],
},
};

Expand All @@ -303,6 +301,7 @@ const habitatTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.pounds(.3),
inertia: [1, 1, 1],
},
};

Expand All @@ -314,6 +313,7 @@ const habitatResearchTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.pounds(.3),
inertia: [1, 1, 1],
},
};

Expand All @@ -325,6 +325,7 @@ const habitatControlTemplate: Node.TemplatedNode<Node.Obj> = {
restitution: .3,
friction: 1,
mass: Mass.pounds(.3),
inertia: [1, 1, 1],
},
};

Expand Down