载入中...
搜索中...
未找到
eve::physics::Mechanism2D类 参考

Composed 2D mechanical assembly owned by a World. 更多...

#include <Mechanism2D.h>

Public 类型

enum class  Kind { CrankSlider , Shaft , Ratchet }
 Assembly kind. 更多...
 

Public 成员函数

 Mechanism2D (const Mechanism2D &)=delete
 
Mechanism2D & operator= (const Mechanism2D &)=delete
 
int getId () const
 Stable world-local identifier.
 
std::string getKind () const
 Kind name: "crankSlider", "shaft", or "ratchet".
 
World * getWorld () const
 Owning world, or null after invalidation.
 
bool isValid () const
 Whether the assembly and its primary joints are still live.
 
Joint2D * getDriveJoint () const
 Primary revolute (crank / shaft / ratchet wheel).
 
Joint2D * getCrankPinJoint () const
 Crank-to-rod revolute, or null for shaft/ratchet.
 
Joint2D * getSliderPinJoint () const
 Rod-to-slider revolute, or null for shaft/ratchet.
 
Joint2D * getSliderJoint () const
 Frame-to-slider prismatic, or null for shaft/ratchet.
 
float getDriveAngle () const
 Current drive revolute angle in radians.
 
float getSliderTranslation () const
 Current slider translation in pixels (crank-slider only).
 
float getSpinSpeed () const
 Relative spin speed in radians/second.
 
void setDrive (float speed, float maxTorque)
 Enables a continuous drive motor on the primary revolute.
 
void clearDrive ()
 Disables the continuous drive motor.
 
bool isDriveEnabled () const
 Whether a continuous drive motor is configured.
 
void setRatchetDirection (int direction)
 Sets ratchet freewheel direction (+1 or -1).
 
int getRatchetDirection () const
 Current ratchet freewheel direction (+1 or -1).
 
void setRatchetEngagementTorque (float torque)
 Sets reverse-lock torque for ratchet engagement.
 
float getRatchetEngagementTorque () const
 Current ratchet engagement torque in newton-metres.
 
void destroy ()
 Destroys owned joints and invalidates this wrapper.
 
void invalidate ()
 Internal invalidation used by world teardown.
 
void syncBeforeStep ()
 Internal: applies ratchet lock / drive before a solver step.
 
 ~Mechanism2D ()
 

友元

class World
 

详细描述

Composed 2D mechanical assembly owned by a World.

Builds crank-slider, shaft, and ratchet mechanisms from Joint2D primitives. Ratchet one-way locking is applied automatically during World::step.

@ownership World owns the mechanism and the joints it creates. Borrowed Body inputs are never retained as caller ownership. @lifetime Valid until Mechanism2D::destroy(), World::destroy(), or dependent body/joint invalidation. @thread Call on the owning physics thread. @reentrancy Does not invoke callbacks.

在文件 Mechanism2D.h 第 25 行定义.

成员枚举类型说明

◆ Kind

Assembly kind.

枚举值
CrankSlider 
Shaft 
Ratchet 

在文件 Mechanism2D.h 第 28 行定义.

构造及析构函数说明

◆ Mechanism2D()

eve::physics::Mechanism2D::Mechanism2D ( const Mechanism2D &  )
delete

◆ ~Mechanism2D()

eve::physics::Mechanism2D::~Mechanism2D ( )

在文件 Mechanism2D.cpp 第 25 行定义.

引用了 destroy.

成员函数说明

◆ clearDrive()

void eve::physics::Mechanism2D::clearDrive ( )

Disables the continuous drive motor.

在文件 Mechanism2D.cpp 第 81 行定义.

◆ destroy()

void eve::physics::Mechanism2D::destroy ( )

Destroys owned joints and invalidates this wrapper.

在文件 Mechanism2D.cpp 第 128 行定义.

◆ getCrankPinJoint()

Joint2D * eve::physics::Mechanism2D::getCrankPinJoint ( ) const
inline

Crank-to-rod revolute, or null for shaft/ratchet.

返回
Borrowed joint owned by the parent World, or null when unused/invalid. @ownership World owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism2D::destroy(), Joint2D::destroy(), or World::destroy().

在文件 Mechanism2D.h 第 60 行定义.

◆ getDriveAngle()

float eve::physics::Mechanism2D::getDriveAngle ( ) const

Current drive revolute angle in radians.

在文件 Mechanism2D.cpp 第 50 行定义.

◆ getDriveJoint()

Joint2D * eve::physics::Mechanism2D::getDriveJoint ( ) const
inline

Primary revolute (crank / shaft / ratchet wheel).

返回
Borrowed joint owned by the parent World, or null after invalidation. @ownership World owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism2D::destroy(), Joint2D::destroy(), or World::destroy().

在文件 Mechanism2D.h 第 53 行定义.

◆ getId()

int eve::physics::Mechanism2D::getId ( ) const
inline

Stable world-local identifier.

在文件 Mechanism2D.h 第 34 行定义.

◆ getKind()

std::string eve::physics::Mechanism2D::getKind ( ) const

Kind name: "crankSlider", "shaft", or "ratchet".

在文件 Mechanism2D.cpp 第 27 行定义.

◆ getRatchetDirection()

int eve::physics::Mechanism2D::getRatchetDirection ( ) const
inline

Current ratchet freewheel direction (+1 or -1).

在文件 Mechanism2D.h 第 97 行定义.

◆ getRatchetEngagementTorque()

float eve::physics::Mechanism2D::getRatchetEngagementTorque ( ) const
inline

Current ratchet engagement torque in newton-metres.

在文件 Mechanism2D.h 第 101 行定义.

◆ getSliderJoint()

Joint2D * eve::physics::Mechanism2D::getSliderJoint ( ) const
inline

Frame-to-slider prismatic, or null for shaft/ratchet.

返回
Borrowed joint owned by the parent World, or null when unused/invalid. @ownership World owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism2D::destroy(), Joint2D::destroy(), or World::destroy().

在文件 Mechanism2D.h 第 74 行定义.

◆ getSliderPinJoint()

Joint2D * eve::physics::Mechanism2D::getSliderPinJoint ( ) const
inline

Rod-to-slider revolute, or null for shaft/ratchet.

返回
Borrowed joint owned by the parent World, or null when unused/invalid. @ownership World owns the joint; this mechanism only borrows it. @lifetime Valid until Mechanism2D::destroy(), Joint2D::destroy(), or World::destroy().

在文件 Mechanism2D.h 第 67 行定义.

◆ getSliderTranslation()

float eve::physics::Mechanism2D::getSliderTranslation ( ) const

Current slider translation in pixels (crank-slider only).

在文件 Mechanism2D.cpp 第 55 行定义.

◆ getSpinSpeed()

float eve::physics::Mechanism2D::getSpinSpeed ( ) const

Relative spin speed in radians/second.

在文件 Mechanism2D.cpp 第 65 行定义.

◆ getWorld()

World * eve::physics::Mechanism2D::getWorld ( ) const
inline

Owning world, or null after invalidation.

返回
Borrowed world pointer. @ownership World owns this mechanism; the returned pointer is borrowed. @lifetime Valid until World::destroy() or this mechanism's invalidation.

在文件 Mechanism2D.h 第 43 行定义.

◆ invalidate()

void eve::physics::Mechanism2D::invalidate ( )

Internal invalidation used by world teardown.

在文件 Mechanism2D.cpp 第 119 行定义.

◆ isDriveEnabled()

bool eve::physics::Mechanism2D::isDriveEnabled ( ) const
inline

Whether a continuous drive motor is configured.

在文件 Mechanism2D.h 第 92 行定义.

◆ isValid()

bool eve::physics::Mechanism2D::isValid ( ) const

Whether the assembly and its primary joints are still live.

在文件 Mechanism2D.cpp 第 36 行定义.

◆ operator=()

Mechanism2D & eve::physics::Mechanism2D::operator= ( const Mechanism2D &  )
delete

◆ setDrive()

void eve::physics::Mechanism2D::setDrive ( float  speed,
float  maxTorque 
)

Enables a continuous drive motor on the primary revolute.

参数
speedTarget speed in radians/second (ratchet remaps onto freewheel direction).
maxTorqueMaximum motor torque in newton-metres.

在文件 Mechanism2D.cpp 第 70 行定义.

◆ setRatchetDirection()

void eve::physics::Mechanism2D::setRatchetDirection ( int  direction)

Sets ratchet freewheel direction (+1 or -1).

在文件 Mechanism2D.cpp 第 89 行定义.

引用了 direction.

◆ setRatchetEngagementTorque()

void eve::physics::Mechanism2D::setRatchetEngagementTorque ( float  torque)

Sets reverse-lock torque for ratchet engagement.

在文件 Mechanism2D.cpp 第 96 行定义.

◆ syncBeforeStep()

void eve::physics::Mechanism2D::syncBeforeStep ( )

Internal: applies ratchet lock / drive before a solver step.

在文件 Mechanism2D.cpp 第 104 行定义.

友元及相关函数文档

◆ World

friend class World
friend

在文件 Mechanism2D.h 第 113 行定义.


该类的文档由以下文件生成: