Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorGrabber.Instance Class Reference

Behavior instance. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorGrabber.Instance:
Dragengine.Scenery.DefaultECBehaviorInstance Dragengine.Scenery.TouchSensorListener Dragengine.Scenery.ECBehaviorInstance

Public Member Functions

void addListener (Listener listener)
 Add listener. More...
 
void addListenerFactory (Block blockFactory)
 Add listener factory using block. More...
 
void addListenerFactory (ListenerFactory factory)
 Add listener factory. More...
 
void addToGameWorld ()
 Add element to game world. More...
 
bool canTouchGrabSpot (ECBehaviorGrabSpot.Instance grabSpot)
 Determine if grab spot can be touched by this grabber. More...
 
ECBehaviorGrabSpot.Instance closestTouchingGrabSpot ()
 Closest touched grab spot closest or null if not found. More...
 
ECBehaviorGrabSpot.Instance closestTouchingGrabSpot (Block ablock)
 Closest touched grab spot closest or null if not found. More...
 
void createListeners (Instance instance)
 Create listeners from factories adding them to behavior instance. More...
 
void dispose ()
 Dispose of claim spot. More...
 
void dispose ()
 Dispose of behavior. More...
 
ECBehaviorGrabSpot.Instance findTouchingGrabSpot (Block ablock)
 Find touching grab spot with block. More...
 
void forEachListenerFactory (Block ablock)
 Visit listener factories with block with argument ListenerFactory. More...
 
void forEachTouchingGrabSpot (Block ablock)
 Visit touching grab spots with block. More...
 
ECComposeAttachResource getAttach ()
 Attach resource. More...
 
ECBehaviorCollider.Instance getCollider ()
 Collider behavior instance or null if not used. More...
 
ECBehaviorCollider getCollider ()
 Collider behavior or null if not used. More...
 
ECComposeCollisionFilter getCollisionFilter ()
 Collision filter. More...
 
ECBehaviorGrabber getECBehavior ()
 Behavior. More...
 
bool getEnabled ()
 Enable grabber. More...
 
ECPShapeList getShape ()
 Touch shape. More...
 
ECBehaviorGrabSpot.Instance getTouchingGrabSpotAt (int index)
 Touching grab spots at index. More...
 
int getTouchingGrabSpotCount ()
 Count of touching grab spots. More...
 
TouchSensor getTouchSensor ()
 Touch sensor. More...
 
ECBehaviorVRHand.Instance getVRHand ()
 VR Hand behavior instance or null if not used. More...
 
ECBehaviorVRHand getVRHand ()
 VR Hand behavior or null if not used. More...
 
void grab (ECBehaviorGrabSpot.Instance spot)
 Grab grab spot. More...
 
void init (StubElement stub)
 Initialize behavior from stub. More...
 
bool isGrabSpotTouching (ECBehaviorGrabSpot.Instance grabSpot)
 Grab spot is touching. More...
 
Instance new (BehaviorElementClass eclass, ECBehaviorCollider collider)
 Create behavior element class. More...
 
Instance new (BehaviorElementClass eclass, ECBehaviorCollider collider, String id)
 Create behavior element class. More...
 
Instance new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, ECBehaviorCollider collider, String id, String prefix)
 Create behavior element class. More...
 
Instance new (BehaviorElementClass eclass, ECBehaviorVRHand vrHand, String id)
 Create behavior element class. More...
 
Instance new (ECBehaviorGrabber ecbehavior, BehaviorElement element)
 Create element. More...
 
void regrab (ECBehaviorGrabSpot.Instance grabSpot)
 Safely grab a different grab spot. More...
 
void release ()
 Release grab spot if grabbing one. More...
 
void removeFromGameWorld ()
 Remove element from game world. More...
 
void removeListener (Listener listener)
 Remove listener. More...
 
void setEnabled (bool enabled)
 Enable/disable grabber. More...
 
void setGrabSpot (ECBehaviorGrabSpot.Instance grabSpot)
 Set grabbed grab spot. More...
 
ECBehaviorGrabSpot.Instance touchingGrabSpotClosestTo (DVector position)
 Touched grab spot closest to position or null if not found. More...
 
ECBehaviorGrabSpot.Instance touchingGrabSpotClosestTo (DVector position, Block ablock)
 Touched grab spot closest to position or null if not found. More...
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance
void attachToParent (Element parent)
 Attach element to object set by the mapper in the IGDE World Editor. More...
 
void enterFrame ()
 Frame update started. More...
 
void geometryChanged ()
 Position or orientation changed. More...
 
BehaviorElement getElement ()
 Behavior element to apply behavior to. More...
 
int getInstanceIndex ()
 Behavior instance index. More...
 
DefaultECBehaviorInstance new (BehaviorElement element)
 Create default composeable instance. More...
 
void postThink (float elapsed)
 Post thinking after physics processing is finished. More...
 
void readFromFile (PersistencyEnvironment env, FileReader reader)
 Read behavior instance from file. More...
 
bool requiresEnterFrame ()
 Behavior instance requires enterFrame() to be called. More...
 
bool requiresThink ()
 Behavior instance requires think() to be called. More...
 
void stateChanged ()
 State changed (visble, touchable). More...
 
void think (float elapsed)
 Think about what to do for the next frame update. More...
 
void writeToFile (PersistencyEnvironment env, FileWriter writer)
 Write behavior instance to file. More...
 
- Public Member Functions inherited from Dragengine.Scenery.TouchSensorListener
void colliderEntered (Collider collider)
 Collider entered shape. More...
 
void colliderLeft (Collider collider)
 Collider left shape. More...
 

Static Public Member Functions

static ECBehaviorGrabber getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Public Attributes

ECBehaviorCollider.Instance pCollider
 
ECBehaviorGrabber pECBehavior
 
ElementResolver pElementResolver
 
bool pEnabled
 
ECBehaviorGrabSpot.Instance pGrabSpot
 
Array pListeners
 
Array pTouchingGrabSpots
 
TouchSensor pTouchSensor
 
Array pTrackedGrabSpots
 
ECBehaviorVRHand.Instance pVRHand
 

Protected Member Functions

void addTouchingGrabSpot (Collider collider, ECBehaviorGrabSpot.Instance grabSpot)
 Add touching grab spot. More...
 
void addTouchingGrabSpot (ECBehaviorGrabSpot.Instance grabSpot)
 
void attachTouchSensor (StubElement stub, ECBehaviorCollider.Instance collider)
 Attach touch sensor to collider. More...
 
void attachTouchSensor (StubElement stub, ECBehaviorVRHand.Instance vrHand)
 Attach touch sensor to VR hand. More...
 
TouchSensor createTouchSensor (StubElement stub)
 Create touch sensor. More...
 
void removeTouchingGrabSpot (ECBehaviorGrabSpot.Instance grabSpot)
 Remove touching grab spot. More...
 
- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehaviorInstance
void setRequiresEnterFrame (bool required)
 Set if behavior instance requires enterFrame() to be called. More...
 
void setRequiresThink (bool required)
 Set if behavior instance requires think() to be called. More...
 

Detailed Description

Behavior instance.

Member Function Documentation

◆ addListener()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.addListener ( Listener  listener)

Add listener.

◆ addListenerFactory() [1/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.addListenerFactory ( Block  blockFactory)

Add listener factory using block.

Block receives as parameter Instance and returns Listener.

◆ addListenerFactory() [2/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.addListenerFactory ( ListenerFactory  factory)

Add listener factory.

◆ addToGameWorld()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.addToGameWorld ( )

Add element to game world.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ addTouchingGrabSpot() [1/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.addTouchingGrabSpot ( Collider  collider,
ECBehaviorGrabSpot.Instance  grabSpot 
)
protected

Add touching grab spot.

Version
1.19

◆ addTouchingGrabSpot() [2/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.addTouchingGrabSpot ( ECBehaviorGrabSpot.Instance  grabSpot)
protected

◆ attachTouchSensor() [1/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.attachTouchSensor ( StubElement  stub,
ECBehaviorCollider.Instance  collider 
)
protected

Attach touch sensor to collider.

Default implementation calls ECComposeAttachResource.attach().

◆ attachTouchSensor() [2/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.attachTouchSensor ( StubElement  stub,
ECBehaviorVRHand.Instance  vrHand 
)
protected

Attach touch sensor to VR hand.

Default implementation calls ECComposeAttachResource.attach().

◆ canTouchGrabSpot()

bool Dragengine.Scenery.ECBehaviorGrabber.Instance.canTouchGrabSpot ( ECBehaviorGrabSpot.Instance  grabSpot)

Determine if grab spot can be touched by this grabber.

Calls canTouchGrabSpot() on all listeners and checks grab spot enabled state.

◆ closestTouchingGrabSpot() [1/2]

ECBehaviorGrabSpot.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.closestTouchingGrabSpot ( )

Closest touched grab spot closest or null if not found.

Uses the grab slot touch collider position and grabber touch sensor position to calculate distance.

◆ closestTouchingGrabSpot() [2/2]

ECBehaviorGrabSpot.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.closestTouchingGrabSpot ( Block  ablock)

Closest touched grab spot closest or null if not found.

Version
1.10

Same as closestTouchingGrabSpot() but allows to filter grab spots using a block. Block is called with signature (ECBehaviorGrabSpot.Instance) and has to return true to consider the grab spot or false to ignore it.

◆ createListeners()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.createListeners ( Instance  instance)

Create listeners from factories adding them to behavior instance.

◆ createTouchSensor()

TouchSensor Dragengine.Scenery.ECBehaviorGrabber.Instance.createTouchSensor ( StubElement  stub)
protected

Create touch sensor.

◆ dispose() [1/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.dispose ( )

Dispose of claim spot.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ dispose() [2/2]

void Dragengine.Scenery.ECBehaviorGrabber.Instance.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ findTouchingGrabSpot()

ECBehaviorGrabSpot.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.findTouchingGrabSpot ( Block  ablock)

Find touching grab spot with block.

Block is called with signature (ECBehaviorGrabSpot.Instance) or (int index, ECBehaviorGrabSpot.Instance) both returning true if found or false to continue searching.

Returns null if no matching grab spot is found.

◆ forEachListenerFactory()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.forEachListenerFactory ( Block  ablock)

Visit listener factories with block with argument ListenerFactory.

◆ forEachTouchingGrabSpot()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.forEachTouchingGrabSpot ( Block  ablock)

Visit touching grab spots with block.

Block is called with signature (ECBehaviorGrabSpot.Instance) or (int index, ECBehaviorGrabSpot.Instance).

◆ getAttach()

ECComposeAttachResource Dragengine.Scenery.ECBehaviorGrabber.Instance.getAttach ( )

Attach resource.

◆ getBehaviorIn()

static ECBehaviorGrabber Dragengine.Scenery.ECBehaviorGrabber.Instance.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorComponent.

◆ getCollider() [1/2]

ECBehaviorCollider.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.getCollider ( )

Collider behavior instance or null if not used.

◆ getCollider() [2/2]

ECBehaviorCollider Dragengine.Scenery.ECBehaviorGrabber.Instance.getCollider ( )

Collider behavior or null if not used.

◆ getCollisionFilter()

ECComposeCollisionFilter Dragengine.Scenery.ECBehaviorGrabber.Instance.getCollisionFilter ( )

Collision filter.

◆ getECBehavior()

ECBehaviorGrabber Dragengine.Scenery.ECBehaviorGrabber.Instance.getECBehavior ( )

Behavior.

◆ getEnabled()

bool Dragengine.Scenery.ECBehaviorGrabber.Instance.getEnabled ( )

Enable grabber.

◆ getShape()

ECPShapeList Dragengine.Scenery.ECBehaviorGrabber.Instance.getShape ( )

Touch shape.

◆ getTouchingGrabSpotAt()

ECBehaviorGrabSpot.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.getTouchingGrabSpotAt ( int  index)

Touching grab spots at index.

◆ getTouchingGrabSpotCount()

int Dragengine.Scenery.ECBehaviorGrabber.Instance.getTouchingGrabSpotCount ( )

Count of touching grab spots.

◆ getTouchSensor()

TouchSensor Dragengine.Scenery.ECBehaviorGrabber.Instance.getTouchSensor ( )

Touch sensor.

◆ getVRHand() [1/2]

ECBehaviorVRHand.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.getVRHand ( )

VR Hand behavior instance or null if not used.

◆ getVRHand() [2/2]

ECBehaviorVRHand Dragengine.Scenery.ECBehaviorGrabber.Instance.getVRHand ( )

VR Hand behavior or null if not used.

◆ grab()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.grab ( ECBehaviorGrabSpot.Instance  spot)

Grab grab spot.

Exceptions
EInvalidParamspot is null.
EInvalidParamAlready grabbing a grab spot.
EInvalidParamspot is not grabbed.

◆ init()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.init ( StubElement  stub)

Initialize behavior from stub.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ isGrabSpotTouching()

bool Dragengine.Scenery.ECBehaviorGrabber.Instance.isGrabSpotTouching ( ECBehaviorGrabSpot.Instance  grabSpot)

Grab spot is touching.

◆ new() [1/5]

Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider 
)

Create behavior element class.

◆ new() [2/5]

Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.new ( BehaviorElementClass  eclass,
ECBehaviorCollider  collider,
String  id 
)

Create behavior element class.

◆ new() [3/5]

Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
ECBehaviorCollider  collider,
String  id,
String  prefix 
)

Create behavior element class.

These behavior can be null:

  • vrHand
  • collider

◆ new() [4/5]

Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.new ( BehaviorElementClass  eclass,
ECBehaviorVRHand  vrHand,
String  id 
)

Create behavior element class.

◆ new() [5/5]

Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.new ( ECBehaviorGrabber  ecbehavior,
BehaviorElement  element 
)

Create element.

◆ regrab()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.regrab ( ECBehaviorGrabSpot.Instance  grabSpot)

Safely grab a different grab spot.

Convenience method for calling release() then grab() but checking problems before calling release(). This ensures the grabber keeps grabbing the old spot in case something is wrong.

Note
If the current grab spot is the same as the new grab spot nothing is done.

◆ release()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.release ( )

Release grab spot if grabbing one.

◆ removeFromGameWorld()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.removeFromGameWorld ( )

Remove element from game world.

Reimplemented from Dragengine.Scenery.DefaultECBehaviorInstance.

◆ removeListener()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.removeListener ( Listener  listener)

Remove listener.

◆ removeTouchingGrabSpot()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.removeTouchingGrabSpot ( ECBehaviorGrabSpot.Instance  grabSpot)
protected

Remove touching grab spot.

◆ setEnabled()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.setEnabled ( bool  enabled)

Enable/disable grabber.

◆ setGrabSpot()

void Dragengine.Scenery.ECBehaviorGrabber.Instance.setGrabSpot ( ECBehaviorGrabSpot.Instance  grabSpot)

Set grabbed grab spot.

Warning
For use by ECBehaviorGrabSpot only.

◆ touchingGrabSpotClosestTo() [1/2]

ECBehaviorGrabSpot.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.touchingGrabSpotClosestTo ( DVector  position)

Touched grab spot closest to position or null if not found.

Uses the grab slot touch collider position to calculate distance.

◆ touchingGrabSpotClosestTo() [2/2]

ECBehaviorGrabSpot.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.touchingGrabSpotClosestTo ( DVector  position,
Block  ablock 
)

Touched grab spot closest to position or null if not found.

Version
1.10

Same as touchingGrabSpotClosestTo(DVector) but allows to filter grab spots using a block. Block is called with signature (ECBehaviorGrabSpot.Instance) and has to return true to consider the grab spot or false to ignore it.

Member Data Documentation

◆ pCollider

ECBehaviorCollider.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.pCollider

◆ pECBehavior

ECBehaviorGrabber Dragengine.Scenery.ECBehaviorGrabber.Instance.pECBehavior

◆ pElementResolver

ElementResolver Dragengine.Scenery.ECBehaviorGrabber.Instance.pElementResolver

◆ pEnabled

bool Dragengine.Scenery.ECBehaviorGrabber.Instance.pEnabled

◆ pGrabSpot

ECBehaviorGrabSpot.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.pGrabSpot

◆ pListeners

Array Dragengine.Scenery.ECBehaviorGrabber.Instance.pListeners

◆ pTouchingGrabSpots

Array Dragengine.Scenery.ECBehaviorGrabber.Instance.pTouchingGrabSpots

◆ pTouchSensor

TouchSensor Dragengine.Scenery.ECBehaviorGrabber.Instance.pTouchSensor

◆ pTrackedGrabSpots

Array Dragengine.Scenery.ECBehaviorGrabber.Instance.pTrackedGrabSpots

◆ pVRHand

ECBehaviorVRHand.Instance Dragengine.Scenery.ECBehaviorGrabber.Instance.pVRHand

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