Module: Box2D::Native
- Extended by:
- FFI::Library
- Defined in:
- lib/box2d/native.rb
Defined Under Namespace
Modules: BodyType, HexColor, JointType, ShapeType, TOIState Classes: AABB, BodyDef, BodyEvents, BodyId, BodyMoveEvent, Capsule, CastOutput, ChainDef, ChainId, ChainSegment, Circle, CollisionPlane, ContactBeginTouchEvent, ContactData, ContactEndTouchEvent, ContactEvents, ContactHitEvent, CosSin, Counters, DebugDraw, DistanceInput, DistanceJointDef, DistanceOutput, DynamicTree, ExplosionDef, Filter, FilterJointDef, Hull, JointId, Manifold, ManifoldPoint, MassData, Mat22, MotorJointDef, MouseJointDef, Plane, PlaneResult, PlaneSolverResult, Polygon, PrismaticJointDef, Profile, QueryFilter, RayCastInput, RayResult, RevoluteJointDef, Rot, Segment, SegmentDistanceResult, SensorBeginTouchEvent, SensorEndTouchEvent, SensorEvents, ShapeCastInput, ShapeCastPairInput, ShapeDef, ShapeId, ShapeProxy, Simplex, SimplexCache, SimplexVertex, SurfaceMaterial, Sweep, TOIInput, TOIOutput, Transform, TreeStats, Vec2, Version, WeldJointDef, WheelJointDef, WorldDef, WorldId
Constant Summary collapse
- ABI_LAYOUTS =
{ "Version" => {size: 12, alignment: 4, offsets: {major: 0, minor: 4, revision: 8}}, "Vec2" => {size: 8, alignment: 4, offsets: {x: 0, y: 4}}, "CosSin" => {size: 8, alignment: 4, offsets: {cosine: 0, sine: 4}}, "Rot" => {size: 8, alignment: 4, offsets: {c: 0, s: 4}}, "Transform" => {size: 16, alignment: 4, offsets: {p: 0, q: 8}}, "Mat22" => {size: 16, alignment: 4, offsets: {cx: 0, cy: 8}}, "AABB" => {size: 16, alignment: 4, offsets: {lowerBound: 0, upperBound: 8}}, "Plane" => {size: 12, alignment: 4, offsets: {normal: 0, offset: 8}}, "RayCastInput" => {size: 20, alignment: 4, offsets: {origin: 0, translation: 8, maxFraction: 16}}, "ShapeProxy" => {size: 72, alignment: 4, offsets: {points: 0, count: 64, radius: 68}}, "ShapeCastInput" => {size: 88, alignment: 4, offsets: {proxy: 0, translation: 72, maxFraction: 80, canEncroach: 84}}, "CastOutput" => {size: 28, alignment: 4, offsets: {normal: 0, point: 8, fraction: 16, iterations: 20, hit: 24}}, "MassData" => {size: 16, alignment: 4, offsets: {mass: 0, center: 4, rotationalInertia: 12}}, "Circle" => {size: 12, alignment: 4, offsets: {center: 0, radius: 8}}, "Capsule" => {size: 20, alignment: 4, offsets: {center1: 0, center2: 8, radius: 16}}, "Polygon" => {size: 144, alignment: 4, offsets: {vertices: 0, normals: 64, centroid: 128, radius: 136, count: 140}}, "Segment" => {size: 16, alignment: 4, offsets: {point1: 0, point2: 8}}, "ChainSegment" => {size: 36, alignment: 4, offsets: {ghost1: 0, segment: 8, ghost2: 24, chainId: 32}}, "Hull" => {size: 68, alignment: 4, offsets: {points: 0, count: 64}}, "SegmentDistanceResult" => {size: 28, alignment: 4, offsets: {closest1: 0, closest2: 8, fraction1: 16, fraction2: 20, distanceSquared: 24}}, "SimplexCache" => {size: 8, alignment: 2, offsets: {count: 0, indexA: 2, indexB: 5}}, "DistanceInput" => {size: 180, alignment: 4, offsets: {proxyA: 0, proxyB: 72, transformA: 144, transformB: 160, useRadii: 176}}, "DistanceOutput" => {size: 36, alignment: 4, offsets: {pointA: 0, pointB: 8, normal: 16, distance: 24, iterations: 28, simplexCount: 32}}, "SimplexVertex" => {size: 36, alignment: 4, offsets: {wA: 0, wB: 8, w: 16, a: 24, indexA: 28, indexB: 32}}, "Simplex" => {size: 112, alignment: 4, offsets: {v1: 0, v2: 36, v3: 72, count: 108}}, "ShapeCastPairInput" => {size: 192, alignment: 4, offsets: {proxyA: 0, proxyB: 72, transformA: 144, transformB: 160, translationB: 176, maxFraction: 184, canEncroach: 188}}, "Sweep" => {size: 40, alignment: 4, offsets: {localCenter: 0, c1: 8, c2: 16, q1: 24, q2: 32}}, "TOIInput" => {size: 228, alignment: 4, offsets: {proxyA: 0, proxyB: 72, sweepA: 144, sweepB: 184, maxFraction: 224}}, "TOIOutput" => {size: 8, alignment: 4, offsets: {state: 0, fraction: 4}}, "ManifoldPoint" => {size: 48, alignment: 4, offsets: {point: 0, anchorA: 8, anchorB: 16, separation: 24, normalImpulse: 28, tangentImpulse: 32, totalNormalImpulse: 36, normalVelocity: 40, id: 44, persisted: 46}}, "Manifold" => {size: 112, alignment: 4, offsets: {normal: 0, rollingImpulse: 8, points: 12, pointCount: 108}}, "DynamicTree" => {size: 72, alignment: 8, offsets: {nodes: 0, root: 8, nodeCount: 12, nodeCapacity: 16, freeList: 20, proxyCount: 24, leafIndices: 32, leafBoxes: 40, leafCenters: 48, binIndices: 56, rebuildCapacity: 64}}, "TreeStats" => {size: 8, alignment: 4, offsets: {nodeVisits: 0, leafVisits: 4}}, "PlaneResult" => {size: 16, alignment: 4, offsets: {plane: 0, hit: 12}}, "CollisionPlane" => {size: 24, alignment: 4, offsets: {plane: 0, pushLimit: 12, push: 16, clipVelocity: 20}}, "PlaneSolverResult" => {size: 12, alignment: 4, offsets: {position: 0, iterationCount: 8}}, "WorldId" => {size: 4, alignment: 2, offsets: {index1: 0, generation: 2}}, "BodyId" => {size: 8, alignment: 4, offsets: {index1: 0, world0: 4, generation: 6}}, "ShapeId" => {size: 8, alignment: 4, offsets: {index1: 0, world0: 4, generation: 6}}, "ChainId" => {size: 8, alignment: 4, offsets: {index1: 0, world0: 4, generation: 6}}, "JointId" => {size: 8, alignment: 4, offsets: {index1: 0, world0: 4, generation: 6}}, "RayResult" => {size: 40, alignment: 4, offsets: {shapeId: 0, point: 8, normal: 16, fraction: 24, nodeVisits: 28, leafVisits: 32, hit: 36}}, "WorldDef" => {size: 104, alignment: 8, offsets: {gravity: 0, restitutionThreshold: 8, hitEventThreshold: 12, contactHertz: 16, contactDampingRatio: 20, maxContactPushSpeed: 24, jointHertz: 28, jointDampingRatio: 32, maximumLinearSpeed: 36, frictionCallback: 40, restitutionCallback: 48, enableSleep: 56, enableContinuous: 57, workerCount: 60, enqueueTask: 64, finishTask: 72, userTaskContext: 80, userData: 88, internalValue: 96}}, "BodyDef" => {size: 80, alignment: 8, offsets: {type: 0, position: 4, rotation: 12, linearVelocity: 20, angularVelocity: 28, linearDamping: 32, angularDamping: 36, gravityScale: 40, sleepThreshold: 44, name: 48, userData: 56, enableSleep: 64, isAwake: 65, fixedRotation: 66, isBullet: 67, isEnabled: 68, allowFastRotation: 69, internalValue: 72}}, "Filter" => {size: 24, alignment: 8, offsets: {categoryBits: 0, maskBits: 8, groupIndex: 16}}, "QueryFilter" => {size: 16, alignment: 8, offsets: {categoryBits: 0, maskBits: 8}}, "SurfaceMaterial" => {size: 24, alignment: 4, offsets: {friction: 0, restitution: 4, rollingResistance: 8, tangentSpeed: 12, userMaterialId: 16, customColor: 20}}, "ShapeDef" => {size: 80, alignment: 8, offsets: {userData: 0, material: 8, density: 32, filter: 40, isSensor: 64, enableSensorEvents: 65, enableContactEvents: 66, enableHitEvents: 67, enablePreSolveEvents: 68, invokeContactCreation: 69, updateBodyMass: 70, internalValue: 72}}, "ChainDef" => {size: 72, alignment: 8, offsets: {userData: 0, points: 8, count: 16, materials: 24, materialCount: 32, filter: 40, isLoop: 64, enableSensorEvents: 65, internalValue: 68}}, "Profile" => {size: 88, alignment: 4, offsets: {step: 0, pairs: 4, collide: 8, solve: 12, mergeIslands: 16, prepareStages: 20, solveConstraints: 24, prepareConstraints: 28, integrateVelocities: 32, warmStart: 36, solveImpulses: 40, integratePositions: 44, relaxImpulses: 48, applyRestitution: 52, storeImpulses: 56, splitIslands: 60, transforms: 64, hitEvents: 68, refit: 72, bullets: 76, sleepIslands: 80, sensors: 84}}, "Counters" => {size: 88, alignment: 4, offsets: {bodyCount: 0, shapeCount: 4, contactCount: 8, jointCount: 12, islandCount: 16, stackUsed: 20, staticTreeHeight: 24, treeHeight: 28, byteCount: 32, taskCount: 36, colorCounts: 40}}, "DistanceJointDef" => {size: 96, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, localAnchorA: 16, localAnchorB: 24, length: 32, enableSpring: 36, hertz: 40, dampingRatio: 44, enableLimit: 48, minLength: 52, maxLength: 56, enableMotor: 60, maxMotorForce: 64, motorSpeed: 68, collideConnected: 72, userData: 80, internalValue: 88}}, "MotorJointDef" => {size: 64, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, linearOffset: 16, angularOffset: 24, maxForce: 28, maxTorque: 32, correctionFactor: 36, collideConnected: 40, userData: 48, internalValue: 56}}, "MouseJointDef" => {size: 56, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, target: 16, hertz: 24, dampingRatio: 28, maxForce: 32, collideConnected: 36, userData: 40, internalValue: 48}}, "FilterJointDef" => {size: 32, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, userData: 16, internalValue: 24}}, "PrismaticJointDef" => {size: 104, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, localAnchorA: 16, localAnchorB: 24, localAxisA: 32, referenceAngle: 40, enableSpring: 44, hertz: 48, dampingRatio: 52, enableLimit: 56, lowerTranslation: 60, upperTranslation: 64, enableMotor: 68, maxMotorForce: 72, motorSpeed: 76, collideConnected: 80, userData: 88, internalValue: 96}}, "RevoluteJointDef" => {size: 96, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, localAnchorA: 16, localAnchorB: 24, referenceAngle: 32, enableSpring: 36, hertz: 40, dampingRatio: 44, enableLimit: 48, lowerAngle: 52, upperAngle: 56, enableMotor: 60, maxMotorTorque: 64, motorSpeed: 68, drawSize: 72, collideConnected: 76, userData: 80, internalValue: 88}}, "WeldJointDef" => {size: 72, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, localAnchorA: 16, localAnchorB: 24, referenceAngle: 32, linearHertz: 36, angularHertz: 40, linearDampingRatio: 44, angularDampingRatio: 48, collideConnected: 52, userData: 56, internalValue: 64}}, "WheelJointDef" => {size: 96, alignment: 8, offsets: {bodyIdA: 0, bodyIdB: 8, localAnchorA: 16, localAnchorB: 24, localAxisA: 32, enableSpring: 40, hertz: 44, dampingRatio: 48, enableLimit: 52, lowerTranslation: 56, upperTranslation: 60, enableMotor: 64, maxMotorTorque: 68, motorSpeed: 72, collideConnected: 76, userData: 80, internalValue: 88}}, "ExplosionDef" => {size: 32, alignment: 8, offsets: {maskBits: 0, position: 8, radius: 16, falloff: 20, impulsePerLength: 24}}, "SensorBeginTouchEvent" => {size: 16, alignment: 4, offsets: {sensorShapeId: 0, visitorShapeId: 8}}, "SensorEndTouchEvent" => {size: 16, alignment: 4, offsets: {sensorShapeId: 0, visitorShapeId: 8}}, "SensorEvents" => {size: 24, alignment: 8, offsets: {beginEvents: 0, endEvents: 8, beginCount: 16, endCount: 20}}, "ContactBeginTouchEvent" => {size: 128, alignment: 4, offsets: {shapeIdA: 0, shapeIdB: 8, manifold: 16}}, "ContactEndTouchEvent" => {size: 16, alignment: 4, offsets: {shapeIdA: 0, shapeIdB: 8}}, "ContactHitEvent" => {size: 36, alignment: 4, offsets: {shapeIdA: 0, shapeIdB: 8, point: 16, normal: 24, approachSpeed: 32}}, "ContactEvents" => {size: 40, alignment: 8, offsets: {beginEvents: 0, endEvents: 8, hitEvents: 16, beginCount: 24, endCount: 28, hitCount: 32}}, "BodyMoveEvent" => {size: 40, alignment: 8, offsets: {transform: 0, bodyId: 16, userData: 24, fellAsleep: 32}}, "BodyEvents" => {size: 16, alignment: 8, offsets: {moveEvents: 0, moveCount: 8}}, "ContactData" => {size: 128, alignment: 4, offsets: {shapeIdA: 0, shapeIdB: 8, manifold: 16}}, "DebugDraw" => {size: 112, alignment: 8, offsets: {DrawPolygonFcn: 0, DrawSolidPolygonFcn: 8, DrawCircleFcn: 16, DrawSolidCircleFcn: 24, DrawSolidCapsuleFcn: 32, DrawSegmentFcn: 40, DrawTransformFcn: 48, DrawPointFcn: 56, DrawStringFcn: 64, drawingBounds: 72, useDrawingBounds: 88, drawShapes: 89, drawJoints: 90, drawJointExtras: 91, drawBounds: 92, drawMass: 93, drawBodyNames: 94, drawContacts: 95, drawGraphColors: 96, drawContactNormals: 97, drawContactImpulses: 98, drawContactFeatures: 99, drawFrictionImpulses: 100, drawIslands: 101, context: 104}} }.freeze