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

Function MakeB2Island

DynamicsB2Island.go:178–199  ·  view source on GitHub ↗

B2Island.cpp * Position Correction Notes ========================= I tried the several algorithms for position correction of the 2D revolute joint. I looked at these systems: - simple pendulum (1m diameter sphere on massless 5m stick) with initial angular velocity of 100 rad/s. - suspension br

(bodyCapacity int, contactCapacity int, jointCapacity int, listener B2ContactListenerInterface)

Source from the content-addressed store, hash-verified

176*/
177
178func MakeB2Island(bodyCapacity int, contactCapacity int, jointCapacity int, listener B2ContactListenerInterface) B2Island {
179
180 island := B2Island{}
181
182 island.M_bodyCapacity = bodyCapacity
183 island.M_contactCapacity = contactCapacity
184 island.M_jointCapacity = jointCapacity
185 island.M_bodyCount = 0
186 island.M_contactCount = 0
187 island.M_jointCount = 0
188
189 island.M_listener = listener
190
191 island.M_bodies = make([]*B2Body, bodyCapacity)
192 island.M_contacts = make([]B2ContactInterface, contactCapacity)
193 island.M_joints = make([]B2JointInterface, jointCapacity)
194
195 island.M_velocities = make([]B2Velocity, bodyCapacity)
196 island.M_positions = make([]B2Position, bodyCapacity)
197
198 return island
199}
200
201func (island *B2Island) Destroy() {
202

Callers 2

SolveMethod · 0.85
SolveTOIMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected