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

Method Create

DynamicsB2Fixture.go:206–231  ·  view source on GitHub ↗
(body *B2Body, def *B2FixtureDef)

Source from the content-addressed store, hash-verified

204}
205
206func (fix *B2Fixture) Create(body *B2Body, def *B2FixtureDef) {
207 fix.M_userData = def.UserData
208 fix.M_friction = def.Friction
209 fix.M_restitution = def.Restitution
210
211 fix.M_body = body
212 fix.M_next = nil
213
214 fix.M_filter = def.Filter
215
216 fix.M_isSensor = def.IsSensor
217
218 fix.M_shape = def.Shape.Clone()
219
220 // Reserve proxy space
221 childCount := fix.M_shape.GetChildCount()
222 fix.M_proxies = make([]B2FixtureProxy, childCount)
223
224 for i := 0; i < childCount; i++ {
225 fix.M_proxies[i].Fixture = nil
226 fix.M_proxies[i].ProxyId = E_nullProxy
227 }
228 fix.M_proxyCount = 0
229
230 fix.M_density = def.Density
231}
232
233func (fix *B2Fixture) Destroy() {
234

Callers 1

CreateFixtureFromDefMethod · 0.95

Calls 2

CloneMethod · 0.65
GetChildCountMethod · 0.65

Tested by

no test coverage detected