MCPcopy Create free account
hub / github.com/ByteArena/box2d / SetLinearVelocity

Method SetLinearVelocity

DynamicsB2Body.go:188–198  ·  view source on GitHub ↗
(v B2Vec2)

Source from the content-addressed store, hash-verified

186}
187
188func (body *B2Body) SetLinearVelocity(v B2Vec2) {
189 if body.M_type == B2BodyType.B2_staticBody {
190 return
191 }
192
193 if B2Vec2Dot(v, v) > 0.0 {
194 body.SetAwake(true)
195 }
196
197 body.M_linearVelocity = v
198}
199
200func (body B2Body) GetLinearVelocity() B2Vec2 {
201 return body.M_linearVelocity

Callers

nothing calls this directly

Calls 2

SetAwakeMethod · 0.95
B2Vec2DotFunction · 0.85

Tested by

no test coverage detected