Blender V2.61 - r43446
Public Types | Public Member Functions | Protected Attributes

SCA_ISensor Class Reference

#include <SCA_ISensor.h>

Inheritance diagram for SCA_ISensor:
Inheritance graph
[legend]

List of all members.

Public Types

enum  sensortype { ST_NONE = 0, ST_TOUCH, ST_NEAR, ST_RADAR }

Public Member Functions

 SCA_ISensor (SCA_IObject *gameobj, class SCA_EventManager *eventmgr)
 ~SCA_ISensor ()
virtual void ReParent (SCA_IObject *parent)
void Activate (class SCA_LogicManager *logicmgr)
virtual bool Evaluate ()=0
virtual bool IsPositiveTrigger ()
virtual void Init ()
virtual CValueGetReplica ()=0
void SetPulseMode (bool posmode, bool negmode, int freq)
void SetInvert (bool inv)
void SetLevel (bool lvl)
void SetTap (bool tap)
virtual void RegisterToManager ()
virtual void UnregisterToManager ()
void Replace_EventManager (class SCA_LogicManager *logicmgr)
void ReserveController (int num)
void LinkToController (SCA_IController *controller)
void UnlinkController (SCA_IController *controller)
void UnlinkAllControllers ()
void ActivateControllers (class SCA_LogicManager *logicmgr)
virtual void ProcessReplica ()
virtual double GetNumber ()
virtual sensortype GetSensorType ()
void Suspend ()
bool IsSuspended ()
bool GetState ()
bool GetPrevState ()
int GetPosTicks ()
int GetNegTicks ()
void Resume ()
void ClrLink ()
void IncLink ()
void DecLink ()
bool IsNoLink () const

Protected Attributes

class SCA_EventManagerm_eventmgr
bool m_pos_pulsemode
bool m_neg_pulsemode
int m_pulse_frequency
int m_pos_ticks
int m_neg_ticks
bool m_invert
bool m_level
bool m_tap
bool m_reset
bool m_suspended
int m_links
bool m_state
bool m_prev_state
std::vector< class
SCA_IController * > 
m_linkedcontrollers

Detailed Description

Interface Class for all logic Sensors. Implements pulsemode,pulsefrequency Use of SG_DList element: link sensors to their respective event manager Head: SCA_EventManager::m_sensors Use of SG_QList element: not used

Definition at line 48 of file SCA_ISensor.h.


Member Enumeration Documentation

Enumerator:
ST_NONE 
ST_TOUCH 
ST_NEAR 
ST_RADAR 

Definition at line 97 of file SCA_ISensor.h.


Constructor & Destructor Documentation

SCA_ISensor::SCA_ISensor ( SCA_IObject gameobj,
class SCA_EventManager eventmgr 
)
SCA_ISensor::~SCA_ISensor ( )

Definition at line 78 of file SCA_ISensor.cpp.


Member Function Documentation

void SCA_ISensor::Activate ( class SCA_LogicManager logicmgr)
void SCA_ISensor::ActivateControllers ( class SCA_LogicManager logicmgr)
void SCA_ISensor::ClrLink ( ) [inline]

Definition at line 187 of file SCA_ISensor.h.

References m_links.

Referenced by SCA_IObject::ReParentLogic().

void SCA_ISensor::DecLink ( )
virtual bool SCA_ISensor::Evaluate ( ) [pure virtual]
int SCA_ISensor::GetNegTicks ( ) [inline]

get the number of ticks since the last negative pulse

Definition at line 179 of file SCA_ISensor.h.

References m_neg_ticks.

double SCA_ISensor::GetNumber ( ) [virtual]

Reimplemented from SCA_ILogicBrick.

Definition at line 127 of file SCA_ISensor.cpp.

References GetState().

int SCA_ISensor::GetPosTicks ( ) [inline]

get the number of ticks since the last positive pulse

Definition at line 173 of file SCA_ISensor.h.

References m_pos_ticks.

bool SCA_ISensor::GetPrevState ( ) [inline]

get the previous state of the sensor: positive or negative

Definition at line 167 of file SCA_ISensor.h.

References m_prev_state.

virtual CValue* SCA_ISensor::GetReplica ( ) [pure virtual]
virtual sensortype SCA_ISensor::GetSensorType ( ) [inline, virtual]

Reimplemented in KX_NearSensor, KX_RadarSensor, and KX_TouchSensor.

Definition at line 152 of file SCA_ISensor.h.

References ST_NONE.

bool SCA_ISensor::GetState ( void  ) [inline]
void SCA_ISensor::IncLink ( ) [inline]

Definition at line 189 of file SCA_ISensor.h.

References m_links, and RegisterToManager().

Referenced by BL_ConvertSensors(), and SCA_IController::LinkToSensor().

void SCA_ISensor::Init ( void  ) [virtual]
bool SCA_ISensor::IsNoLink ( ) const [inline]

Definition at line 192 of file SCA_ISensor.h.

References m_links.

bool SCA_ISensor::IsPositiveTrigger ( ) [virtual]
bool SCA_ISensor::IsSuspended ( )

Is this sensor switched off?

Definition at line 137 of file SCA_ISensor.cpp.

References m_suspended.

Referenced by SCA_MouseManager::NextFrame(), and SCA_JoystickManager::NextFrame().

void SCA_ISensor::LinkToController ( SCA_IController controller)

Definition at line 188 of file SCA_ISensor.cpp.

References m_linkedcontrollers.

Referenced by SCA_LogicManager::RegisterToSensor().

void SCA_ISensor::ProcessReplica ( ) [virtual]
void SCA_ISensor::RegisterToManager ( ) [virtual]

Definition at line 167 of file SCA_ISensor.cpp.

References Init(), m_eventmgr, m_state, and SCA_EventManager::RegisterSensor().

Referenced by IncLink().

void SCA_ISensor::ReParent ( SCA_IObject parent) [virtual]

Reimplemented from SCA_ILogicBrick.

Reimplemented in SCA_ActuatorSensor, KX_ArmatureSensor, KX_NearSensor, and KX_TouchSensor.

Definition at line 47 of file SCA_ISensor.cpp.

Referenced by SCA_IObject::ReParentLogic().

void SCA_ISensor::Replace_EventManager ( class SCA_LogicManager logicmgr)
void SCA_ISensor::ReserveController ( int  num) [inline]

Definition at line 139 of file SCA_ISensor.h.

References m_linkedcontrollers.

Referenced by BL_ConvertSensors().

void SCA_ISensor::Resume ( void  )

Resume sensing.

Definition at line 142 of file SCA_ISensor.cpp.

References m_suspended.

void SCA_ISensor::SetInvert ( bool  inv)

Set inversion of pulses on or off.

Definition at line 111 of file SCA_ISensor.cpp.

References m_invert.

Referenced by BL_ConvertSensors().

void SCA_ISensor::SetLevel ( bool  lvl)

set the level detection on or off

Definition at line 116 of file SCA_ISensor.cpp.

References m_level.

Referenced by BL_ConvertSensors().

void SCA_ISensor::SetPulseMode ( bool  posmode,
bool  negmode,
int  freq 
)

Set parameters for the pulsing behaviour.

Parameters:
posmodeTrigger positive pulses?
negmodeTrigger negative pulses?
freqFrequency to use when doing pulsing.

Definition at line 103 of file SCA_ISensor.cpp.

References m_neg_pulsemode, m_pos_pulsemode, and m_pulse_frequency.

Referenced by BL_ConvertSensors().

void SCA_ISensor::SetTap ( bool  tap)

Definition at line 121 of file SCA_ISensor.cpp.

References m_tap.

Referenced by BL_ConvertSensors().

void SCA_ISensor::Suspend ( void  )

Stop sensing for a while.

Definition at line 132 of file SCA_ISensor.cpp.

References m_suspended.

void SCA_ISensor::UnlinkAllControllers ( )

Definition at line 210 of file SCA_ISensor.cpp.

References m_linkedcontrollers.

Referenced by SCA_LogicManager::RemoveSensor().

void SCA_ISensor::UnlinkController ( SCA_IController controller)
void SCA_ISensor::UnregisterToManager ( ) [virtual]

Reimplemented in KX_TouchSensor.

Definition at line 220 of file SCA_ISensor.cpp.

References m_eventmgr, m_links, and SCA_EventManager::RemoveSensor().

Referenced by DecLink(), and SCA_LogicManager::RemoveSensor().


Member Data Documentation

bool SCA_ISensor::m_invert [protected]
bool SCA_ISensor::m_level [protected]
std::vector<class SCA_IController*> SCA_ISensor::m_linkedcontrollers [protected]
int SCA_ISensor::m_links [protected]
bool SCA_ISensor::m_neg_pulsemode [protected]

Pulse negative pulses?

Definition at line 58 of file SCA_ISensor.h.

Referenced by Activate(), SCA_ISensor(), and SetPulseMode().

int SCA_ISensor::m_neg_ticks [protected]

Number of ticks since the last negative pulse.

Definition at line 67 of file SCA_ISensor.h.

Referenced by Activate(), GetNegTicks(), and SCA_ISensor().

bool SCA_ISensor::m_pos_pulsemode [protected]

Pulse positive pulses?

Definition at line 55 of file SCA_ISensor.h.

Referenced by Activate(), SCA_ISensor(), and SetPulseMode().

int SCA_ISensor::m_pos_ticks [protected]

Number of ticks since the last positive pulse.

Definition at line 64 of file SCA_ISensor.h.

Referenced by Activate(), GetPosTicks(), and SCA_ISensor().

bool SCA_ISensor::m_prev_state [protected]

previous state (for tap option)

Definition at line 91 of file SCA_ISensor.h.

Referenced by Activate(), GetPrevState(), and SCA_ISensor().

Repeat frequency in pulse mode.

Definition at line 61 of file SCA_ISensor.h.

Referenced by Activate(), SCA_RandomSensor::Evaluate(), SCA_ISensor(), and SetPulseMode().

bool SCA_ISensor::m_reset [protected]
bool SCA_ISensor::m_state [protected]

current sensor state

Definition at line 88 of file SCA_ISensor.h.

Referenced by Activate(), GetState(), RegisterToManager(), and SCA_ISensor().

bool SCA_ISensor::m_suspended [protected]
bool SCA_ISensor::m_tap [protected]

tap mode

Definition at line 76 of file SCA_ISensor.h.

Referenced by Activate(), SCA_KeyboardSensor::Evaluate(), SCA_ISensor(), and SetTap().


The documentation for this class was generated from the following files: