Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes

# PortalNode Class Reference

A node in the scene graph that can hold a Portal Polygon, which is a rectangle. More...

Inheritance diagram for PortalNode:

List of all members.

## Public Member Functions
| PortalNode (string name)
| Default constructor, just an empty node, no geo This is used to read portal from model.
| PortalNode (string name, Point3 pos, float scale)
| Create a default rectangle as portal.
| PortalNode (string name, Point3 pos)
| Create a default rectangle as portal.
| addVertex (Point3 const vertex)
| Adds a new vertex to the portal polygon.
| clearVertices ()
| Resets the vertices of the portal to the empty list.
NodePath | getCellIn ()
| Sets the cell that this portal belongs to.
NodePath | getCellOut ()
| Sets the cell that this portal leads out to.
BitMaskunsigned | getFromPortalMask ()
BitMaskunsigned | getIntoPortalMask ()
int | getMaxDepth ()
| Returns the maximum depth this portal will be visible at.
int | getNumVertices ()
| Returns the number of vertices in the portal polygon.
bool | getPortalGeom ()
| Returns the current state of the portal_geom flag.
Point3 const | getVertex (int n)
| Returns the nth vertex of the portal polygon.
list | getVertices ()
bool | isClipPlane ()
| Is this portal clipping against its left-right planes.
bool | isOpen ()
| Is this portal open from current camera zone.
bool | isVisible ()
| Is this portal facing the camera.
| setCellIn (NodePath const cell)
| Sets the cell that this portal belongs to.
| setCellOut (NodePath const cell)
| Sets the cell that this portal leads out to.
| setClipPlane (bool value)
| this is set if the portal will clip against its left and right planes
| setFromPortalMask (BitMaskunsigned int, 32 mask)
| Sets the "from" PortalMask.
| setIntoPortalMask (BitMaskunsigned int, 32 mask)
| Sets the "into" PortalMask.
| setMaxDepth (int value)
| Set the maximum depth this portal will be visible at.
| setOpen (bool value)
| Python sets this based on curent camera zone.
| setPortalGeom (bool flag)
| Sets the state of the "portal geom" flag for this PortalNode.
| setPortalMask (BitMaskunsigned int, 32 mask)
| Simultaneously sets both the "from" and "into" PortalMask values to the same thing.
| setVisible (bool value)
| this is set if the portal is facing camera
## Static Public Member Functions
static TypeHandle | getClassType ()
## Public Attributes
BitMaskunsigned | int
| Returns the current "from" PortalMask.

## Detailed Description

A node in the scene graph that can hold a Portal Polygon, which is a rectangle.

Other types of polygons are not supported for now. It also holds a PT(PandaNode) Cell that this portal is connected to

## Constructor & Destructor Documentation

PortalNode | ( | string | name | ) |

Default constructor, just an empty node, no geo This is used to read portal from model.

You can also use this from python to create an empty portal. Then you can set the vertices yourself, with addVertex.

PortalNode | ( | string | name,
|  | Point3 | pos,
|  | float | scale
| ) |  |

Create a default rectangle as portal.

Use this to create an arbitrary portal and setup from Python

PortalNode | ( | string | name,
|  | Point3 | pos
| ) |  |

Create a default rectangle as portal.

Use this to create an arbitrary portal and setup from Python

## Member Function Documentation

addVertex | ( | Point3 const | vertex | ) |

Adds a new vertex to the portal polygon.

The vertices should be defined in a counterclockwise orientation when viewing through the portal.

clearVertices | ( |  | ) |

Resets the vertices of the portal to the empty list.

NodePath getCellIn | ( |  | ) |

Sets the cell that this portal belongs to.

NodePath getCellOut | ( |  | ) |

Sets the cell that this portal leads out to.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from PandaNode.

BitMaskunsigned getFromPortalMask | ( |  | ) |

BitMaskunsigned getIntoPortalMask | ( |  | ) |

int getMaxDepth | ( |  | ) |

Returns the maximum depth this portal will be visible at.

int getNumVertices | ( |  | ) |

Returns the number of vertices in the portal polygon.

bool getPortalGeom | ( |  | ) |

Returns the current state of the portal_geom flag.

See set_portal_geom().

Point3 const getVertex | ( | int | n | ) |

Returns the nth vertex of the portal polygon.

list getVertices | ( |  | ) |

bool isClipPlane | ( |  | ) |

Is this portal clipping against its left-right planes.

bool isOpen | ( |  | ) |

Is this portal open from current camera zone.

bool isVisible | ( |  | ) |

Is this portal facing the camera.

setCellIn | ( | NodePath const | cell | ) |

Sets the cell that this portal belongs to.

setCellOut | ( | NodePath const | cell | ) |

Sets the cell that this portal leads out to.

setClipPlane | ( | bool | value | ) |

this is set if the portal will clip against its left and right planes

setFromPortalMask | ( | BitMaskunsigned | int,
|  | 32 | mask
| ) |  |

Sets the "from" PortalMask.

In order for a portal to be detected from this object into another object, the intersection of this object's "from" mask and the other object's "into" mask must be nonzero.

setIntoPortalMask | ( | BitMaskunsigned | int,
|  | 32 | mask
| ) |  |

Sets the "into" PortalMask.

In order for a portal to be detected from another object into this object, the intersection of the other object's "from" mask and this object's "into" mask must be nonzero.

setMaxDepth | ( | int | value | ) |

Set the maximum depth this portal will be visible at.

setOpen | ( | bool | value | ) |

Python sets this based on curent camera zone.

setPortalGeom | ( | bool | flag | ) |

Sets the state of the "portal geom" flag for this PortalNode.

Normally, this is false; when this is set true, the PortalSolids in this node will test for portals with actual renderable geometry, in addition to whatever PortalSolids may be indicated by the from_portal_mask.

Setting this to true causes this to test *all* GeomNodes for portals. It is an all-or-none thing; there is no way to portal with only some GeomNodes, as GeomNodes have no into_portal_mask.

setPortalMask | ( | BitMaskunsigned | int,
|  | 32 | mask
| ) |  |

Simultaneously sets both the "from" and "into" PortalMask values to the same thing.

setVisible | ( | bool | value | ) |

this is set if the portal is facing camera

## Member Data Documentation

BitMaskunsigned int

Returns the current "from" PortalMask.

Returns the current "into" PortalMask.

In order for a portal to be detected from this object into another object, the intersection of this object's "from" mask and the other object's "into" mask must be nonzero.

In order for a portal to be detected from another object into this object, the intersection of the other object's "from" mask and this object's "into" mask must be nonzero.

Reimplemented from PandaNode.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties