-
Notifications
You must be signed in to change notification settings - Fork 70
/
rigid.go
33 lines (24 loc) · 931 Bytes
/
rigid.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2019, Cogent Core. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package physics
import (
"cogentcore.org/core/math32"
)
// Rigid contains the full specification of a given object's basic physics
// properties including position, orientation, velocity. These
type Rigid struct {
// 1/mass -- 0 for no mass
InvMass float32
// COR or coefficient of restitution -- how elastic is the collision i.e., final velocity / initial velocity
Bounce float32 `min:"0" max:"1"`
// friction coefficient -- how much friction is generated by transverse motion
Friction float32
// record of computed force vector from last iteration
Force math32.Vector3
// Last calculated rotational inertia matrix in local coords
RotInertia math32.Matrix3
}
// Defaults sets defaults only if current values are nil
func (ps *Rigid) Defaults() {
}