mozaSdk
Public 成员函数 | Public 属性 | Protected 成员函数 | Protected 属性 | 所有成员列表
RS21::direct_input::Effect类 参考abstract

The Effect class 效果抽象类 更多...

#include <Effect.h>

类 RS21::direct_input::Effect 继承关系图:
RS21::direct_input::ETConstantForce RS21::direct_input::ETDamper RS21::direct_input::ETFriction RS21::direct_input::ETInertia RS21::direct_input::ETSine RS21::direct_input::ETSpring

Public 成员函数

void start ()
 力效果启动 更多...
 
void stop ()
 stop 停止力效果 更多...
 
void setAttackLevel (const unsigned long newAttackLevel=0)
 设置发力级别 更多...
 
unsigned long attackLevel () const
 获取发力级别 更多...
 
unsigned long attackTime () const
 获取发力时间 更多...
 
void setAttackTime (const unsigned long newAttackTime=500)
 设置发力时间 更多...
 
unsigned long fadeLevel () const
 fadeLevel 获取衰减级别 更多...
 
void setFadeLevel (const unsigned long newFadeLevel=0)
 设置衰减级别 更多...
 
unsigned long fadeTime () const
 fadeTime 获取衰减时间,单位:ms 更多...
 
void setFadeTime (const unsigned long newFadeTime=1000)
 setFadeTime 设置衰减时间 更多...
 
unsigned long duration () const
 duration 获取效果持续时间 更多...
 
void setDuration (const unsigned long newDuration=2000)
 setDuration 设置效果持续时间 更多...
 
unsigned long samplePeriod () const
 获取采样周期 更多...
 
void setSamplePeriod (const unsigned long newSamplePeriod=0)
 setSamplePeriod 设置采样周期 更多...
 
unsigned long gain () const
 获取增益 更多...
 
void setGain (const unsigned long newGain=DI_FFNOMINALMAX)
 设置增益值 更多...
 
unsigned long triggerButton () const
 获取出发效果按钮 更多...
 
void setTriggerButton (const unsigned long newButtonIndex=DIEB_NOTRIGGER)
 设置触发效果按钮 更多...
 
unsigned long triggerRepeatInterval () const
 获取触发效果重复间隔 更多...
 
void setTriggerRepeatInterval (const unsigned long newRepeatInterval=0)
 设置触发效果间隔 更多...
 
unsigned long rgdAxesCount ()
 效果相关轴数 更多...
 
unsigned long * rgdAxes ()
 获取相关轴数组 更多...
 
void setRgdAxes (unsigned long *axes, unsigned long size)
 设置相关轴 更多...
 
long xDirection ()
 获取effect在x轴向的角度 更多...
 
void setXDirection (long newDegree=1)
 设置effect在x轴向的角度 更多...
 
std::string effectName () const
 获取当前effect的名称 更多...
 
void setEffectName (const std::string &newEffectName)
 设置effect别名 更多...
 
int index () const
 获取当前effect的index 更多...
 
void setIndex (unsigned int newIndex)
 设置当前effect的index 更多...
 

Public 属性

bool m_isRunning = false
 

Protected 成员函数

 Effect (Device *device)
 
 ~Effect ()
 
virtual void downloadToDevice (LPDIRECTINPUTDEVICE8 device)=0
 
std::map< std::string, std::string > allGeneralEffectInfo ()
 

Protected 属性

uint16_t m_effectId
 
std::string m_effectName
 
LPDIRECTINPUTEFFECT m_effect = NULL
 
DIEFFECT m_diEffect
 
DIENVELOPE m_diEnvelope
 
LONG * m_lDirection = nullptr
 
DWORD * m_dwAxes = nullptr
 
Device * m_device = nullptr
 
unsigned int m_index = 0
 

详细描述

The Effect class 效果抽象类

  1. 提供效果开始、结束API
  2. 提供通用参数的获取、修改接口

构造及析构函数说明

◆ Effect()

RS21::direct_input::Effect::Effect ( Device *  device)
protected

◆ ~Effect()

RS21::direct_input::Effect::~Effect ( )
protected

成员函数说明

◆ allGeneralEffectInfo()

std::map<std::string, std::string> RS21::direct_input::Effect::allGeneralEffectInfo ( )
protected

◆ attackLevel()

unsigned long RS21::direct_input::Effect::attackLevel ( ) const

获取发力级别

返回
发力级别

◆ attackTime()

unsigned long RS21::direct_input::Effect::attackTime ( ) const

获取发力时间

返回
发力时间,单位:ms

◆ downloadToDevice()

virtual void RS21::direct_input::Effect::downloadToDevice ( LPDIRECTINPUTDEVICE8  device)
protectedpure virtual

◆ duration()

unsigned long RS21::direct_input::Effect::duration ( ) const

duration 获取效果持续时间

返回
效果持续时间,单位:ms

◆ effectName()

std::string RS21::direct_input::Effect::effectName ( ) const

获取当前effect的名称

返回
当前effect的名称

◆ fadeLevel()

unsigned long RS21::direct_input::Effect::fadeLevel ( ) const

fadeLevel 获取衰减级别

返回
衰减级别

◆ fadeTime()

unsigned long RS21::direct_input::Effect::fadeTime ( ) const

fadeTime 获取衰减时间,单位:ms

返回
衰减时间

◆ gain()

unsigned long RS21::direct_input::Effect::gain ( ) const

获取增益

返回
增益值(根据报告描述符:0~10000)

◆ index()

int RS21::direct_input::Effect::index ( ) const

获取当前effect的index

返回
当前effect的index

◆ rgdAxes()

unsigned long* RS21::direct_input::Effect::rgdAxes ( )

获取相关轴数组

返回
相关轴数组

◆ rgdAxesCount()

unsigned long RS21::direct_input::Effect::rgdAxesCount ( )

效果相关轴数

返回
轴数

◆ samplePeriod()

unsigned long RS21::direct_input::Effect::samplePeriod ( ) const

获取采样周期

返回
采样周期,单位:ms

◆ setAttackLevel()

void RS21::direct_input::Effect::setAttackLevel ( const unsigned long  newAttackLevel = 0)

设置发力级别

参数
newAttackLevel发力级别

◆ setAttackTime()

void RS21::direct_input::Effect::setAttackTime ( const unsigned long  newAttackTime = 500)

设置发力时间

参数
newAttackTime发力时间,单位:ms

◆ setDuration()

void RS21::direct_input::Effect::setDuration ( const unsigned long  newDuration = 2000)

setDuration 设置效果持续时间

参数
newDuration效果持续时间,单位:ms

◆ setEffectName()

void RS21::direct_input::Effect::setEffectName ( const std::string &  newEffectName)

设置effect别名

参数
newEffectNameeffect的别名

◆ setFadeLevel()

void RS21::direct_input::Effect::setFadeLevel ( const unsigned long  newFadeLevel = 0)

设置衰减级别

参数
newFadeLevel衰减级别

◆ setFadeTime()

void RS21::direct_input::Effect::setFadeTime ( const unsigned long  newFadeTime = 1000)

setFadeTime 设置衰减时间

参数
newFadeTime衰减时间,单位:ms

◆ setGain()

void RS21::direct_input::Effect::setGain ( const unsigned long  newGain = DI_FFNOMINALMAX)

设置增益值

参数
newGain增益值(根据报告描述符:0~10000)

◆ setIndex()

void RS21::direct_input::Effect::setIndex ( unsigned int  newIndex)

设置当前effect的index

参数
newIndex当前effect的index,index >= 0

◆ setRgdAxes()

void RS21::direct_input::Effect::setRgdAxes ( unsigned long *  axes,
unsigned long  size 
)

设置相关轴

参数
axes相关轴数组指针
size相关轴数组长度

◆ setSamplePeriod()

void RS21::direct_input::Effect::setSamplePeriod ( const unsigned long  newSamplePeriod = 0)

setSamplePeriod 设置采样周期

参数
newSamplePeriod采样周期值,单位:ms

◆ setTriggerButton()

void RS21::direct_input::Effect::setTriggerButton ( const unsigned long  newButtonIndex = DIEB_NOTRIGGER)

设置触发效果按钮

参数
newButtonIndex触发效果按钮

◆ setTriggerRepeatInterval()

void RS21::direct_input::Effect::setTriggerRepeatInterval ( const unsigned long  newRepeatInterval = 0)

设置触发效果间隔

参数
newRepeatInterval触发效果间隔

◆ setXDirection()

void RS21::direct_input::Effect::setXDirection ( long  newDegree = 1)

设置effect在x轴向的角度

参数
newDegreex轴向的角度

◆ start()

void RS21::direct_input::Effect::start ( )

力效果启动

◆ stop()

void RS21::direct_input::Effect::stop ( )

stop 停止力效果

◆ triggerButton()

unsigned long RS21::direct_input::Effect::triggerButton ( ) const

获取出发效果按钮

返回
效果按钮

◆ triggerRepeatInterval()

unsigned long RS21::direct_input::Effect::triggerRepeatInterval ( ) const

获取触发效果重复间隔

返回
触发效果重复间隔

◆ xDirection()

long RS21::direct_input::Effect::xDirection ( )

获取effect在x轴向的角度

返回
effect在x轴的角度

类成员变量说明

◆ m_device

Device* RS21::direct_input::Effect::m_device = nullptr
protected

◆ m_diEffect

DIEFFECT RS21::direct_input::Effect::m_diEffect
protected

◆ m_diEnvelope

DIENVELOPE RS21::direct_input::Effect::m_diEnvelope
protected

◆ m_dwAxes

DWORD* RS21::direct_input::Effect::m_dwAxes = nullptr
protected

◆ m_effect

LPDIRECTINPUTEFFECT RS21::direct_input::Effect::m_effect = NULL
protected

◆ m_effectId

uint16_t RS21::direct_input::Effect::m_effectId
protected

◆ m_effectName

std::string RS21::direct_input::Effect::m_effectName
protected

◆ m_index

unsigned int RS21::direct_input::Effect::m_index = 0
protected

◆ m_isRunning

bool RS21::direct_input::Effect::m_isRunning = false

◆ m_lDirection

LONG* RS21::direct_input::Effect::m_lDirection = nullptr
protected