Download Now
Forums

    Reference Codebot.Physics.pas

    Part of the Codebot Render package

    The Codebot.Physics unit makes the Chipmunk2D physics library easy to use from Pascal by wrapping it in records.

    Record Description
    TSpace The simulated world, with its gravity, bodies, shapes, and joints.
    TBody A rigid body in a space, with its position, angle, velocity, and mass.
    TShape Gives a body its shape. TCircle, TSegment, and TPolygon are its kinds.
    TJoint Connects two bodies. TPinJoint, TSlideJoint, TPivotJoint, TGrooveJoint, TDampedSpringJoint, TDampedRotarySpringJoint, TRotaryLimitJoint, TRatchetJoint, TGearJoint, and TMotorJoint are its kinds.
    TArbiter Describes a collision between two shapes.

    Each record is the same pointer Chipmunk2D uses, so the records convert freely to and from the routines of Codebot.Interop.Chipmunk2D, and Chipmunk2D manages everything itself without anything being duplicated in Pascal. The records add properties, methods such as Space.NewBody.NewCircle(20), and for in loops over the bodies, shapes, and joints of a space.

    The unit also gives you routines that compute the moment, area, and centroid of shapes, and that build convex hulls and polylines.

    Items 424 items

    NameKindLine
    AreaForCirclefunction107
    AreaForPolygonfunction111
    AreaForSegmentfunction108
    bodyDynamicconstant134
    bodyKinematicconstant135
    bodyStaticconstant136
    BoolFlagsconstant81
    CentroidForPolygonfunction113
    ClosestPointOnSegmentfunction118
    collideGrabconstant88
    ConvexHullfunction116
    FilterAllconstant84
    MaskAllconstant82
    MaskToStrfunction91
    MatrixIdentityconstant80
    MomentForBoxfunction105, 106
    MomentForCirclefunction99, 100
    MomentForPolygonfunction102, 103
    MomentForSegmentfunction101
    NewSpacefunction1439
    shapeCircleconstant125
    shapePolygonconstant127
    shapeSegmentconstant126
    StrToMaskfunction93
    TArbiterrecord825
    Reffield827
    CallWildcardBeginAfunction864
    CallWildcardBeginBfunction865
    CallWildcardPostSolveAprocedure868
    CallWildcardPostSolveBprocedure869
    CallWildcardPreSolveAfunction866
    CallWildcardPreSolveBfunction867
    CallWildcardSeparateAprocedure870
    CallWildcardSeparateBprocedure871
    GetBodiesprocedure857
    GetShapesprocedure855
    Ignorefunction853
    Implicitoperator828, 829
    IsFirstContactfunction859
    IsNilfunction850
    IsRemovalfunction861
    ContactPointSetproperty883
    Countproperty885
    Depthproperty892
    Frictionproperty877
    Normalproperty887
    PointAproperty889
    PointBproperty890
    Restitutionproperty874
    SurfaceVelocityproperty879
    TotalImpulseproperty895
    TotalKineticEnergyproperty897
    UserDataproperty881
    TArbiterMethodprocedural901
    TBitmaskalias71
    TBodyrecord376
    Reffield378
    ApplyForceAtBodyprocedure458
    ApplyForceAtWorldprocedure456
    ApplyImpulseAtBodyprocedure462
    ApplyImpulseAtWorldprocedure460
    BodyToWorldfunction452
    Equaloperator381
    Freeprocedure419
    Implicitoperator379, 380
    IsNilfunction421
    IsSleepingfunction447
    NewBoxfunction432, 433, 434
    NewCirclefunction426, 428
    NewPolygonfunction436
    NewPolygonRawfunction439
    NewSegmentfunction430
    NotEqualoperator382
    Sleepprocedure443
    SleepWithGroupprocedure445
    UpdatePositionprocedure472
    UpdateVelocityprocedure469
    VelocityAtBodyfunction466
    VelocityAtWorldfunction464
    WakeUpprocedure450
    WorldToBodyfunction454
    Angleproperty491
    AngularVelocityproperty493
    CenterOfGravityproperty482
    Forceproperty489
    Kindproperty475
    KineticEnergyproperty500
    Massproperty478
    Momentproperty480
    Positionproperty484
    PositionFuncproperty504
    Rotationproperty498
    Shapeproperty506
    Shapesproperty510
    Torqueproperty496
    UserDataproperty508
    Velocityproperty486
    VelocityFuncproperty502
    TBodyHelperhelper1409
    EachArbiterprocedure1418, 1419
    Spacefunction1414
    Jointsproperty1421
    TBodyJointEnumeratorrecord810
    Createfunction816
    GetEnumeratorfunction819
    MoveNextfunction817
    Currentproperty818
    TBodyKindalias131
    TBodyShapeEnumeratorrecord361
    Createfunction367
    GetEnumeratorfunction370
    MoveNextfunction368
    Currentproperty369
    TCirclerecord147
    Reffield149
    Freeprocedure161
    Implicitoperator150, 151, 152, 153
    IsNilfunction163
    Reshapeprocedure165
    Offsetproperty169
    Radiusproperty167
    TCircleHelperhelper1287
    Basefunction1290
    TCollisionEventprocedural1153
    TCollisionEventsrecord1156
    OnBeginfield1159
    OnPostSolvefield1164
    OnPreSolvefield1162
    OnSeparatefield1166
    TCollisionFilterEventprocedural1151
    TCollisionHandleralias76
    TCollisionTypealias73
    TDampedRotarySpringJointrecord637
    Reffield639
    Implicitoperator640, 641
    Dampingproperty657
    RestAngleproperty653
    Stiffnessproperty655
    TorqueFuncproperty659
    TDampedRotarySpringJointHelperhelper1361
    Basefunction1364
    TDampedSpringJointrecord603
    Reffield605
    Implicitoperator606, 607
    Dampingproperty630
    ForceFuncproperty632
    PinAproperty623
    PinBproperty624
    RestLengthproperty626
    Stiffnessproperty628
    TDampedSpringJointHelperhelper1353
    Basefunction1356
    TGearJointrecord705
    Reffield707
    Implicitoperator708, 709
    Phaseproperty717
    Ratioproperty719
    TGearJointHelperhelper1385
    Basefunction1388
    TGrooveJointrecord581
    Reffield583
    Implicitoperator584, 585
    GrooveAproperty595
    GrooveBproperty596
    PinBproperty598
    TGrooveJointHelperhelper1345
    Basefunction1348
    TJointrecord739
    Reffield741
    AsDampedRotarySpringfunction779
    AsDampedSpringfunction778
    AsGearfunction782
    AsGroovefunction777
    AsMotorfunction783
    AsPinfunction774
    AsPivotfunction776
    AsRatchetfunction781
    AsRotaryLimitfunction780
    AsSlidefunction775
    Equaloperator744
    Freeprocedure768
    Implicitoperator742, 743
    IsGrabfunction772
    IsNilfunction770
    NotEqualoperator745
    Aproperty787
    Bproperty789
    CollideBodiesproperty791
    ErrorBiasproperty793
    Impulseproperty799
    Kindproperty785
    MaxBiasproperty795
    MaxForceproperty797
    PostSolveproperty803
    PreSolveproperty801
    UserDataproperty805
    TJointHelperhelper1401
    Spacefunction1404
    TJointKindenum141
    jointPinenum value141
    jointSlideenum value141
    jointPivotenum value141
    jointGrooveenum value141
    jointDampedSpringenum value141
    jointDampedRotarySpringenum value142
    jointRotaryLimitenum value142
    jointRatchetenum value142
    jointGearenum value142
    jointMotorenum value142
    jointCustomenum value143
    TMarchSampleprocedural1237
    TMotorJointrecord724
    Reffield726
    Implicitoperator727, 728
    Rateproperty734
    TMotorJointHelperhelper1393
    Basefunction1396
    TPinJointrecord515
    Reffield517
    Implicitoperator518, 519
    Distanceproperty532
    PinAproperty529
    PinBproperty530
    TPinJointHelperhelper1321
    Basefunction1324
    TPivotJointrecord562
    Reffield564
    Implicitoperator565, 566
    PinAproperty574
    PinBproperty575
    TPivotJointHelperhelper1337
    Basefunction1340
    TPolygonrecord209
    Reffield211
    Freeprocedure223
    Implicitoperator212, 213, 214, 215
    IsNilfunction225
    Reshapeprocedure227, 229
    ReshapeRawprocedure232
    Borderproperty234
    Vertproperty238
    VertCountproperty236
    TPolygonHelperhelper1303
    Basefunction1306
    TPolylinerecord1179
    Reffield1181
    Copyfunction1198
    Createfunction1192
    Freeprocedure1194
    Implicitoperator1182, 1183
    IsNilfunction1196
    SimplifyCurvesfunction1202
    SimplifyVertexesfunction1206
    ToArrayfunction1210
    ToConvexHullfunction1208
    Closedproperty1218
    Countproperty1212
    Vertproperty1214
    Vertsproperty1216
    TPolylineSetrecord1241
    Reffield1243
    AddSegmentprocedure1276
    ConvexDecompositionfunction1254
    Createfunction1251
    Freeprocedure1271
    GetEnumeratorfunction1278
    Implicitoperator1244, 1245
    IsNilfunction1273
    MarchHardfunction1265, 1268
    MarchSoftfunction1258, 1261
    Countproperty1280
    Lineproperty1282
    TPolylineSetEnumeratorrecord1223
    Createfunction1229
    MoveNextfunction1230
    Currentproperty1231
    TRatchetJointrecord682
    Reffield684
    Implicitoperator685, 686
    Angleproperty696
    Phaseproperty698
    Ratchetproperty700
    TRatchetJointHelperhelper1377
    Basefunction1380
    TRotaryLimitJointrecord664
    Reffield666
    Implicitoperator667, 668
    Maxproperty677
    Minproperty676
    TRotaryLimitJointHelperhelper1369
    Basefunction1372
    TSegmentrecord174
    Reffield176
    Freeprocedure191
    Implicitoperator177, 178, 179, 180
    IsNilfunction193
    Joinprocedure196
    Aproperty200
    Bproperty202
    Borderproperty198
    Normalproperty204
    TSegmentHelperhelper1295
    Basefunction1298
    TShaperecord243
    Reffield245
    AsCirclefunction288
    AsPolygonfunction289
    AsSegmentfunction290
    CacheBBfunction299
    Collidefunction297
    Equaloperator248
    Freeprocedure284
    Implicitoperator246, 247
    IsNilfunction286
    NotEqualoperator249
    PointQueryfunction293
    SegmentQueryfunction295
    Updatefunction301
    Areaproperty315
    BoundingBoxproperty319
    Categoryproperty351
    CenterOfGravityproperty317
    CollisionTypeproperty356
    Densityproperty311
    Elasticityproperty327
    Filterproperty346
    Frictionproperty330
    Groupproperty348
    Kindproperty305
    Maskproperty354
    Massproperty309
    Momentproperty313
    Nextproperty303
    Sensorproperty323
    SurfaceVelocityproperty333
    UserDataproperty335
    TShapeHelperhelper1311
    Bodyfunction1314
    Spacefunction1316
    TShapeKindalias122
    TSlideJointrecord537
    Reffield539
    Implicitoperator540, 541
    Maxproperty557
    Minproperty556
    PinAproperty553
    PinBproperty554
    TSlideJointHelperhelper1329
    Basefunction1332
    TSpacerecord953
    Reffield955
    Addfunction1059, 1060, 1061
    AddCollisionHandlerfunction1006
    AddDefaultCollisionHandlerfunction1010
    AddPostStepCallbackfunction1014
    AddWildcardHandlerfunction1008
    BoxQueryfunction1088
    Containsfunction1068, 1069, 1070
    DebugDrawprocedure1104
    Freeprocedure986
    Implicitoperator956, 957
    IsNilfunction988
    NewBodyfunction1026
    NewDampedRotarySpringfunction1048
    NewDampedSpringfunction1046
    NewGearfunction1052
    NewGroovefunction1045
    NewKinematicBodyfunction1029
    NewMotorfunction1054
    NewPinfunction1041
    NewPivotfunction1043, 1044
    NewRatchetfunction1051
    NewRotaryLimitfunction1050
    NewSlidefunction1042
    NewStaticBodyfunction1032
    PointQueryfunction1076
    PointQueryNearestfunction1079
    ReindexBodyprocedure1097
    ReindexShapeprocedure1096
    ReindexStaticprocedure1095
    ReleaseBodiesprocedure990
    ReleaseJointsprocedure992
    ReleaseObjectsprocedure996
    Removeprocedure1064, 1065, 1066
    SegmentQueryfunction1082
    SegmentQueryFirstfunction1085
    ShapeQueryfunction1090
    Stepprocedure998
    UseSpatialHashprocedure1100
    Bodiesproperty1136
    CollisionBiasproperty1124
    CollisionPersistenceproperty1126
    CollisionSlopproperty1122
    CurrentTimeStepproperty1128
    Dampingproperty1112
    Gravityproperty1114
    Groundproperty1107
    IdleSpeedThresholdproperty1117
    Iterationsproperty1109
    Jointsproperty1141
    Lockedproperty1130
    Shapesproperty1138
    SleepTimeThresholdproperty1120
    UserDataproperty1132
    TSpaceBodyEnumeratorrecord905
    Createfunction912
    GetEnumeratorfunction915
    MoveNextfunction913
    Currentproperty914
    TSpaceHelperhelper1426
    AddCollisionEventsfunction1429
    AddDefaultCollisionEventsfunction1435
    AddWildcardEventsfunction1432
    TSpaceJointEnumeratorrecord935
    Createfunction945
    GetEnumeratorfunction948
    MoveNextfunction946
    Currentproperty947
    TSpaceShapeEnumeratorrecord920
    Createfunction927
    GetEnumeratorfunction930
    MoveNextfunction928
    Currentproperty929
    VectZeroconstant79