BGE patch: Add level option on sensor and fix sensor reset.
Level option is now available on all sensors but is only implemented on mouse and keyboard sensors. The purpose of that option is to make the sensor react on level rather than edge by default. It's only applicable to state engine system when there is a state transition: the sensor will generate a pulse if the condition is met from the start of the state. Normally, the keyboard sensor generate a pulse only when the key is pressed and not when the key is already pressed. This patch allows to select this behavior. The second part of the patch corrects the reset method for sensors with inverted output.
This commit is contained in:
@@ -54,7 +54,6 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr,
|
||||
m_checkpropval(propval),
|
||||
m_checkpropmaxval(propmaxval),
|
||||
m_checkpropname(propname),
|
||||
m_lastresult(false),
|
||||
m_range_expr(NULL)
|
||||
{
|
||||
//CParser pars;
|
||||
@@ -78,6 +77,7 @@ SCA_PropertySensor::SCA_PropertySensor(SCA_EventManager* eventmgr,
|
||||
void SCA_PropertySensor::Init()
|
||||
{
|
||||
m_recentresult = false;
|
||||
m_lastresult = m_invert?true:false;
|
||||
}
|
||||
|
||||
void SCA_PropertySensor::PrecalculateRangeExpression()
|
||||
|
||||
Reference in New Issue
Block a user