Download Now

    Reference Codebot.Render.Scenes.Physics.pas

    Part of the Codebot Render package

    Each version implies all earlier versions

    The Codebot.Render.Scenes.Physics unit defines TPhysicsScene, which is a widget scene that runs a Chipmunk2D space. The space is stepped at a fixed rate by the step thread of the scene host. Physics is simulated in studio coordinates, which is a fixed area of 1920 by 1080 that is scaled to fill the scene, so the simulation behaves the same at any size. The space is shared by the step and render threads and is locked while either one uses it. Bodies in the space can be dragged with the mouse.

    Items 30 items

    NameKindLine
    GrabAccelerationconstant37
    PhysicsStepconstant34
    StudioHeightconstant32
    StudioWidthconstant31
    TPhysicsSceneclass57
    DoMouseDownprocedure101
    DoMouseMoveprocedure102
    DoMouseUpprocedure103
    DrawCustomBodyfunction83
    DrawCustomJointfunction85
    DrawCustomShapefunction84
    DrawPhysicsprocedure89
    Finalizeprocedure96
    GenerateStudioWallsprocedure81
    Initializeprocedure95
    Lockprocedure112
    PointToStudiofunction75
    ReleaseGrabprocedure110
    ResetSpaceprocedure107
    ScaleToStudioprocedure77
    ShapeNearPointfunction79
    Simulateprocedure72
    Stepprocedure100
    StepIntervalfunction98
    Unlockprocedure114
    GrabBodiesproperty92
    GrabCenteredproperty93
    GrabJointproperty91
    Pausedproperty116
    Spaceproperty90