Partager via


PHYSICSENGINEINIT

4/8/2010

This structure describes the initialization parameters for a physics engine object. To create a physics engine, you must pass a pointer to this structure to TKCreatePhysicsEngine.

Syntax

typedef struct tagPHYSICSENGINEINIT {
    DWORD cbSize;
    DWORD dwEngineType;
    DWORD dwFlags;
    LONG lInitialVelocity; 
    DWORD dwInitialAngle;
    BYTE bXAxisMovementMode;
    BYTE bXAxisBoundaryMode;
    BYTE bYAxisMovementMode;
    BYTE bYAxisBoundaryMode;
    RECT rcBoundary;
    SIZE sizeView;
    POINT ptInitialPosition;
    SIZE sizeItem;
} PHYSICSENGINEINIT;

Members

  • cbSize
    Specifies the size of the PHYSICSENGINEINIT structure in bytes. You must set this value to sizeof(PHYSICSENGINEINIT).
  • dwEngineType
    Reserved; set to 0 (zero).
  • dwFlags
    Specifies the flags which control the behavior of the engine. Valid values are:

    • 0 (zero)
      Default mode.
    • PHYSICSENGINE_FLAG_USERTIME
      User specified time mode.

    In default mode the physics engine reads the time from the system clock.

    In user specified time mode, you must call TKSetPhysicsEngineUserTime to set the time.

  • lInitialVelocity
    Specifies the initial velocity of the touch gesture animation in pixels per second.
  • dwInitialAngle
    Specifies the initial angle for the animation to occur. The angle is specified as a value in the range 0-65536, where 0 is -2pi radians, pointing east, and 65536 is +2pi radians. Angles increase in a counter-clockwise direction.
  • bXAxisMovementMode
    Specifies the X-axis movement mode. You must set this value to PHYSICSENGINE_MOVEMENT_MODE_DECELERATE.
  • bXAxisBoundaryMode
    Specifies the animation behavior when the boundary is reached on the X-axis. Valid values are:

    • PHYSICSENGINE_BOUNDARY_MODE_NONE
      No animation.
    • PHYSICSENGINE_BOUNDARY_MODE_RUBBERBAND
      Rubber band animation.
  • bYAxisMovementMode
    Specifies the Y-axis movement mode. You must set this value to PHYSICSENGINE_MOVEMENT_MODE_DECELERATE.
  • bYAxisBoundaryMode
    Specifies the animation behavior when the boundary is reached on the Y-axis. Acceptable values are

    • PHYSICSENGINE_BOUNDARY_MODE_NONE
      No animation.
    • PHYSICSENGINE_BOUNDARY_MODE_RUBBERBAND
      Rubber band animation.
  • rcBoundary
    Specifies a rectangle that defines the boundary of the content. The boundary contains all content including the entire user control.
  • sizeView
    Specifies the size of the visible region.
  • ptInitialPosition
    Specifies the initial position of the top-left corner of the viewable region.
  • sizeItem
    Specifies the size of an item for snapping. An item size that is less than 1 in either dimension is treated as 1. The physics engine only stops an animation on item boundaries. An item size of 1 lets the physics engine stop at any point on that axis.

Remarks

If any member of the structure contains invalid data, ** TKCreatePhysicsEngine will return E_INVALIDARG.

Requirements

Header GesturePhysicsEngine.h

See Also

Reference

TKCreatePhysicsEngine

Other Resources

Physics Engine Structures