# panda3d.core.PortalNode¶

class PortalNode

Bases: PandaNode

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

Inheritance diagram

__init__(name: str) → None

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.

__init__(name: str, pos: LPoint3, scale: float) → None

Create a default rectangle as portal. Use this to create an arbitrary portal and setup from Python

setPortalMask(mask: PortalMask) → None

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

setFromPortalMask(mask: PortalMask) → None

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(mask: PortalMask) → None

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.

getFromPortalMask() → PortalMask

Returns the current “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.

Return type

getIntoPortalMask() → PortalMask

Returns the current “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.

Return type

setPortalGeom(flag: bool) → None

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.

getPortalGeom() → bool

Returns the current state of the portal_geom flag. See setPortalGeom().

clearVertices() → None

Resets the vertices of the portal to the empty list.

addVertex(vertex: LPoint3) → None

Adds a new vertex to the portal polygon. The vertices should be defined in a counterclockwise orientation when viewing through the portal.

getNumVertices() → int

Returns the number of vertices in the portal polygon.

getVertex(n: int) → LPoint3

Returns the nth vertex of the portal polygon.

Return type

LPoint3

setCellIn(cell: NodePath) → None

Sets the cell that this portal belongs to

getCellIn() → NodePath

Sets the cell that this portal belongs to

Return type

NodePath

setCellOut(cell: NodePath) → None

Sets the cell that this portal leads out to

getCellOut() → NodePath

Sets the cell that this portal leads out to

Return type

NodePath

setClipPlane(value: bool) → None

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

isClipPlane() → bool

Is this portal clipping against its left-right planes

setVisible(value: bool) → None

this is set if the portal is facing camera

isVisible() → bool

Is this portal facing the camera

setMaxDepth(value: int) → None

Set the maximum depth this portal will be visible at

getMaxDepth() → int

Returns the maximum depth this portal will be visible at

setOpen(value: bool) → None

Python sets this based on curent camera zone

isOpen() → bool

Is this portal open from current camera zone

static getClassType() → TypeHandle
Return type

TypeHandle

getVertices() → list
property into_portal_mask
Getter

Returns the current “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.

Setter

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.

Return type

property from_portal_mask
Getter

Returns the current “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.

Setter

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.

Return type

property portal_geom
Getter

Returns the current state of the portal_geom flag. See setPortalGeom().

Setter

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.

Return type

bool

property vertices

Returns the nth vertex of the portal polygon.

Return type

Sequence[LPoint3]

property cell_in
Getter

Sets the cell that this portal belongs to

Setter

Sets the cell that this portal belongs to

Return type

NodePath

property cell_out
Getter

Sets the cell that this portal leads out to

Setter

Sets the cell that this portal leads out to

Return type

NodePath

property clip_plane
Getter

Is this portal clipping against its left-right planes

Setter

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

Return type

bool

property visible
Getter

Is this portal facing the camera

Setter

this is set if the portal is facing camera

Return type

bool

property max_depth
Getter

Returns the maximum depth this portal will be visible at

Setter

Set the maximum depth this portal will be visible at

Return type

int

property open
Getter

Is this portal open from current camera zone

Setter

Python sets this based on curent camera zone

Return type

bool