| Package | org.papervision3d.utils |
| Class | public class InteractiveSceneManager |
| Inheritance | InteractiveSceneManager flash.events.EventDispatcher |
When you create an InteractiveScene3D object, it automatically creates the InteractiveSceneManager (ISM for short) for you. From there on, any 3D object using an interactive material will automatically be given mouse events that are dispatched through the ISM OR the DisplayObject3D itself. The event type is InteractiveScene3DEvent.
ISM has 2 modes:
Object level mode is a bit faster in that sprite containers for the objects are created and then all faces are drawn in that container. You're able to receive mouse events based on the objects, but not the contents of the materials used on the objects.
For example, if you created a movieclip, put UI components in it and applied it to a DisplayObject3D (DO3D for short), you would not be able to interact with those elements in your movieclip. But you WOULD be able to have mouse events on the entire DO3D.
Face level mode creates sprite containers for each face of a DO3D that uses an interactive material and gives you the ability to interact with a movieclips objects like UI components.
For example, if you created a movieclip, put UI components in it and applied it to a DO3D, you would be able to interact with those elements in your movieclip and receive their mouse events like you normally would.
There is one other option for faceLevelMode and that's directly on the DO3D's themselves. This is even heavier in terms of speed, but its there if you need face level access to all DO3D's. DisplayObject3D.faceLevelMode is a public static property that when set to true, causes all DO3D's do create their own sprite containers for their faces. The difference between this and what the ISM does is that, the ISM only draws faces for DO3D's that have interactive materials - giving you the control you need to dictate what needs interactivity and what doesn't.
| Property | Defined by | ||
|---|---|---|---|
| buttonMode : Boolean = false
When set to true, the hand cursor is shown over objects that have mouse events assigned to it.
| InteractiveSceneManager | ||
| container : Sprite
Main container for ISM to create the sub InteractiveSprite containers for the faces and DO3D objects passed in during the render loop
| InteractiveSceneManager | ||
| containerDictionary : Dictionary
A dictionary where the DO3D's and Face3D objects are stored.
| InteractiveSceneManager | ||
| debug : Boolean = false
Setting to true will show output via trace window in IDE or Xray's output
| InteractiveSceneManager | ||
| DEFAULT_FILL_ALPHA : Number = 1 [static]
Alpha value 0-1 of the drawn face
| InteractiveSceneManager | ||
| DEFAULT_FILL_COLOR : Number = 0xFFFFFF [static]
Color used to draw the face in the sprite container
| InteractiveSceneManager | ||
| DEFAULT_LINE_ALPHA : Number = 1 [static]
Alpha value 0-1 of the line drawn around the face
| InteractiveSceneManager | ||
| DEFAULT_LINE_COLOR : Number = -1 [static]
Color used for the line drawn around the face
| InteractiveSceneManager | ||
| DEFAULT_LINE_SIZE : Number = 1 [static]
Line size of the line drawn around the face
| InteractiveSceneManager | ||
| DEFAULT_SPRITE_ALPHA : Number = 1 [static]
Alpha value 0-1 of the sprite container created for DO3D's or Face3D containers in the ISM
| InteractiveSceneManager | ||
| enableMouse : Boolean
Boolean value that sets Mouse3D.enabled = true
| InteractiveSceneManager | ||
| faceDictionary : Dictionary
A dictionary where the InteractiveContainerData objects are stored for DO3D's or Face3D objects.
| InteractiveSceneManager | ||
| faceLevelMode : Boolean = false
This allows objects faces to have their own containers.
| InteractiveSceneManager | ||
| mouse3D : Mouse3D
Mouse3D gives you a pointer in 3D space that orients itself to a face your mouse is currently over.
| InteractiveSceneManager | ||
| mouseInteractionMode : Boolean
If the user sets this to true, then we monitor the allowDraw flag via mouse interaction and we only draw the faces if there's mouse interaction with the scene.
| InteractiveSceneManager | ||
| MOUSE_IS_DOWN : Boolean = false [static]
MOUSE_IS_DOWN is a quick static property to check and is maintained by the ISM
| InteractiveSceneManager | ||
| scene : SceneObject3D
InteractiveScene3D instance, usually passed in by the constructor
| InteractiveSceneManager | ||
| SHOW_DRAWN_FACES : Boolean = false [static]
The ISM, by default, uses a BlendMode.ERASE to hide the hit area of the drawn face.
| InteractiveSceneManager | ||
| virtualMouse : VirtualMouse
VirtualMouse is used with faceLevelMode of ISM or DO3D's.
| InteractiveSceneManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
InteractiveSceneManager(p_scene:SceneObject3D)
| InteractiveSceneManager | ||
|
addInteractiveObject(container3d:Object):void
Adds a DisplayObject3D or Face3D object to the ISM
| InteractiveSceneManager | ||
|
drawFace(container3d:DisplayObject3D, face3d:Face3D, x0:Number, x1:Number, x2:Number, y0:Number, y1:Number, y2:Number):void
drawFace is called from each of the interactive materials in the render loop.
| InteractiveSceneManager | ||
|
resetFaces():void
When called, all faces are cleared and the isDrawn flag is reset on the InteractiveContainerData objects to ready them for the next loop.
| InteractiveSceneManager | ||
|
resizeStage():void
When called, aligns the ISM's container with the scene's container to make sure faces drawn in the ISM are aligned with the scene perfectly
| InteractiveSceneManager | ||
|
setInteractivityDefaults():void
Convenience method to help set the default parameters of the ISM.
| InteractiveSceneManager | ||
|
sortObjects():void
After the render loop is completed, InteractiveScene3D calls this method to sort the interactive scene objects.
| InteractiveSceneManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
handleMouseClick(e:MouseEvent):void
Handles the MOUSE_CLICK event on an InteractiveSprite container
| InteractiveSceneManager | ||
|
handleMouseMove(e:MouseEvent):void
Handles the MOUSE_MOVE event on an InteractiveSprite container
| InteractiveSceneManager | ||
|
handleMouseOut(e:MouseEvent):void
Handles the MOUSE_OUT event on an InteractiveSprite container
| InteractiveSceneManager | ||
|
handleMouseOver(e:MouseEvent):void
Handles the MOUSE_OVER event on an InteractiveSprite container
| InteractiveSceneManager | ||
|
handleMousePress(e:MouseEvent):void
Handles the MOUSE_DOWN event on an InteractiveSprite container
| InteractiveSceneManager | ||
|
handleMouseRelease(e:MouseEvent):void
Handles the MOUSE_UP event on an InteractiveSprite container
| InteractiveSceneManager | ||
|
handleReleaseOutside(e:MouseEvent):void
Handles mouse clicks on the stage.
| InteractiveSceneManager | ||
|
handleStageMouseMove(e:MouseEvent):void
When ISM is in mouseInteractionMode, we capture mouse move events from the stage to trigger a draw
| InteractiveSceneManager | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched when an InteractiveSprite container in the ISM recieves a MouseEvent.CLICK | InteractiveSceneManager | |||
| Dispatched when an InteractiveSprite in the ISM receives a MouseEvent.MOUSE_MOVE event | InteractiveSceneManager | |||
| Dispatched when an InteractiveSprite in the ISM receives an MouseEvent.MOUSE_OUT event | InteractiveSceneManager | |||
| Dispatched when an InteractiveSprite in the ISM receives an MouseEvent.MOUSE_OVER event | InteractiveSceneManager | |||
| Dispatched when an InteractiveSprite in the ISM receives a MouseEvent.MOUSE_PRESS event | InteractiveSceneManager | |||
| Dispatched when an InteractiveSprite in the ISM receives a MouseEvent.MOUSE_RELEASE event | InteractiveSceneManager | |||
| Dispatched when the main container of the ISM is clicked | InteractiveSceneManager | |||
| Dispatched when an InteractiveSprite is created in the ISM for drawing and mouse interaction purposes | InteractiveSceneManager | |||
| buttonMode | property |
public var buttonMode:Boolean = falseWhen set to true, the hand cursor is shown over objects that have mouse events assigned to it.
| container | property |
public var container:SpriteMain container for ISM to create the sub InteractiveSprite containers for the faces and DO3D objects passed in during the render loop
| containerDictionary | property |
public var containerDictionary:DictionaryA dictionary where the DO3D's and Face3D objects are stored. You can get to a DO3D or Face3D by supplying the sprite container reference:
var do3d:DisplayObject3D = containerDictionary[spriteInstance];
or
var face3d:Face3D = containerDictionary[spriteInstance];
| debug | property |
public var debug:Boolean = falseSetting to true will show output via trace window in IDE or Xray's output
| DEFAULT_FILL_ALPHA | property |
public static var DEFAULT_FILL_ALPHA:Number = 1Alpha value 0-1 of the drawn face
| DEFAULT_FILL_COLOR | property |
public static var DEFAULT_FILL_COLOR:Number = 0xFFFFFFColor used to draw the face in the sprite container
| DEFAULT_LINE_ALPHA | property |
public static var DEFAULT_LINE_ALPHA:Number = 1Alpha value 0-1 of the line drawn around the face
| DEFAULT_LINE_COLOR | property |
public static var DEFAULT_LINE_COLOR:Number = -1Color used for the line drawn around the face
| DEFAULT_LINE_SIZE | property |
public static var DEFAULT_LINE_SIZE:Number = 1Line size of the line drawn around the face
| DEFAULT_SPRITE_ALPHA | property |
public static var DEFAULT_SPRITE_ALPHA:Number = 1Alpha value 0-1 of the sprite container created for DO3D's or Face3D containers in the ISM
| enableMouse | property |
enableMouse:Boolean [read-write]Boolean value that sets Mouse3D.enabled = true
Implementation public function get enableMouse():Boolean
public function set enableMouse(value:Boolean):void
| faceDictionary | property |
public var faceDictionary:DictionaryA dictionary where the InteractiveContainerData objects are stored for DO3D's or Face3D objects. You can get to a DO3D or Face3D's InteractiveContainerDate object with:
var icd:InteractiveContainerData = faceDictionary[do3dInstance];
| faceLevelMode | property |
public var faceLevelMode:Boolean = falseThis allows objects faces to have their own containers. When set to true and the DisplayObject3D.faceLevelMode = false, the faces will be drawn in ISM's layer of containers
| mouse3D | property |
public var mouse3D:Mouse3DMouse3D gives you a pointer in 3D space that orients itself to a face your mouse is currently over. It copy's the transform information of the face giving you the ability to do something in 3D at that same location
| mouseInteractionMode | property |
mouseInteractionMode:Boolean [read-write]If the user sets this to true, then we monitor the allowDraw flag via mouse interaction and we only draw the faces if there's mouse interaction with the scene. This is meant to maximize CPU for interactivity If set to true, then leave SHOW_DRAWN_FACES set to false to avoid odd drawings over the 3D scene
Implementation public function get mouseInteractionMode():Boolean
public function set mouseInteractionMode(value:Boolean):void
| MOUSE_IS_DOWN | property |
public static var MOUSE_IS_DOWN:Boolean = falseMOUSE_IS_DOWN is a quick static property to check and is maintained by the ISM
| scene | property |
public var scene:SceneObject3DInteractiveScene3D instance, usually passed in by the constructor
| SHOW_DRAWN_FACES | property |
public static var SHOW_DRAWN_FACES:Boolean = falseThe ISM, by default, uses a BlendMode.ERASE to hide the hit area of the drawn face. Setting this to true will show the drawn faces and give you the ability to add whatever type effects/filters you want over your scene and 3D objects.
When set to true, you should set DEFAULT_SPRITE_ALPHA, DEFAULT_FILL_ALPHA and DEFAULT_FILL_COLOR as these will dictate how the faces are drawn over the scene.
Setting DEFAULT_SPRITE_ALPHA = 0 will give you the same effect as the blendmode, but only slower. A combination of DEFAULT_SPRITE_ALPHA and DEFAULT_FILL_ALPHA along with filters can really give you some nice visual affects over your scene for your 3D objects.
| virtualMouse | property |
public var virtualMouse:VirtualMouseVirtualMouse is used with faceLevelMode of ISM or DO3D's. Its a virtual mouse that causes the objects in your materials movieclip containers to fire off their mouse events such as click, over, out, release, press etc
Using these events requires you only to do what you normally do - establish listeners with your objects like you normally would, and you'll receive them!
| InteractiveSceneManager | () | constructor |
public function InteractiveSceneManager(p_scene:SceneObject3D)Parameters
p_scene:SceneObject3D — The InteractiveScene3D object instance. This is passed in via the constructor of InteractiveScene3D when you create a new one.
|
| addInteractiveObject | () | method |
public function addInteractiveObject(container3d:Object):voidAdds a DisplayObject3D or Face3D object to the ISM
Parameterscontainer3d:Object |
| drawFace | () | method |
public function drawFace(container3d:DisplayObject3D, face3d:Face3D, x0:Number, x1:Number, x2:Number, y0:Number, y1:Number, y2:Number):voiddrawFace is called from each of the interactive materials in the render loop. It either receives DisplayObject3D or a Face3D object reference. It then creates a container if one doesn't exist. Then, it draws the face into the designated container which is an InteractiveSprite.
Parameterscontainer3d:DisplayObject3D |
|
face3d:Face3D |
|
x0:Number |
|
x1:Number |
|
x2:Number |
|
y0:Number |
|
y1:Number |
|
y2:Number |
| handleMouseClick | () | method |
protected function handleMouseClick(e:MouseEvent):voidHandles the MOUSE_CLICK event on an InteractiveSprite container
Parameterse:MouseEvent |
| handleMouseMove | () | method |
protected function handleMouseMove(e:MouseEvent):voidHandles the MOUSE_MOVE event on an InteractiveSprite container
Parameterse:MouseEvent |
| handleMouseOut | () | method |
protected function handleMouseOut(e:MouseEvent):voidHandles the MOUSE_OUT event on an InteractiveSprite container
Parameterse:MouseEvent |
| handleMouseOver | () | method |
protected function handleMouseOver(e:MouseEvent):voidHandles the MOUSE_OVER event on an InteractiveSprite container
Parameterse:MouseEvent |
| handleMousePress | () | method |
protected function handleMousePress(e:MouseEvent):voidHandles the MOUSE_DOWN event on an InteractiveSprite container
Parameterse:MouseEvent |
| handleMouseRelease | () | method |
protected function handleMouseRelease(e:MouseEvent):voidHandles the MOUSE_UP event on an InteractiveSprite container
Parameterse:MouseEvent |
| handleReleaseOutside | () | method |
protected function handleReleaseOutside(e:MouseEvent):voidHandles mouse clicks on the stage. If so, we release a releaseOutside event
Parameterse:MouseEvent |
| handleStageMouseMove | () | method |
protected function handleStageMouseMove(e:MouseEvent):voidWhen ISM is in mouseInteractionMode, we capture mouse move events from the stage to trigger a draw
Parameterse:MouseEvent |
| resetFaces | () | method |
public function resetFaces():voidWhen called, all faces are cleared and the isDrawn flag is reset on the InteractiveContainerData objects to ready them for the next loop. This is called via InteractiveScene3D before the render.
| resizeStage | () | method |
public function resizeStage():voidWhen called, aligns the ISM's container with the scene's container to make sure faces drawn in the ISM are aligned with the scene perfectly
| setInteractivityDefaults | () | method |
public function setInteractivityDefaults():voidConvenience method to help set the default parameters of the ISM. This gives you faceLevelMode and buttonMode interaction on your scene. Setting faceLevelMode = false reverts ISM to Object level mode
| sortObjects | () | method |
public function sortObjects():voidAfter the render loop is completed, InteractiveScene3D calls this method to sort the interactive scene objects. If nothing was drawn into a container, it's completely ignored at this level as well.
| mouseClick | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_CLICK
Dispatched when an InteractiveSprite container in the ISM recieves a MouseEvent.CLICK
Dispatched when a container in the ISM recieves a MouseEvent.CLICK event
| mouseMove | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_MOVE
Dispatched when an InteractiveSprite in the ISM receives a MouseEvent.MOUSE_MOVE event
Dispatched when a container in the ISM receives a MouseEvent.MOUSE_MOVE event
| mouseOut | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_OUT
Dispatched when an InteractiveSprite in the ISM receives an MouseEvent.MOUSE_OUT event
Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OUT event
| mouseOver | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_OVER
Dispatched when an InteractiveSprite in the ISM receives an MouseEvent.MOUSE_OVER event
Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OVER event
| mousePress | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_PRESS
Dispatched when an InteractiveSprite in the ISM receives a MouseEvent.MOUSE_PRESS event
Dispatched when a container in the ISM receives a MouseEvent.MOUSE_PRESS event
| mouseRelease | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_RELEASE
Dispatched when an InteractiveSprite in the ISM receives a MouseEvent.MOUSE_RELEASE event
Dispatched when a container in the ISM receives a MouseEvent.MOUSE_RELEASE event
| mouseReleaseOutside | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_RELEASE_OUTSIDE
Dispatched when the main container of the ISM is clicked
Dispatched when the main container of the ISM is clicked
| objectAdded | event |
org.papervision3d.events.InteractiveScene3DEvent
org.papervision3d.events.InteractiveScene3DEvent.OBJECT_ADDED
Dispatched when an InteractiveSprite is created in the ISM for drawing and mouse interaction purposes
Dispatched when a container is created in the ISM for drawing and mouse interaction purposes