hapdrop
November 21, 2012, 5:50am
1
Under the “Max egger changes and additions(To be available in Panda3D 1.7.1 or later)” section, it describes something about collisions.
How would I know what the best to choose for some particular model? For example, would I choose polyset if I had a character model? What would I choose for a table model? Or a tank vehicle model?
wezu
November 21, 2012, 9:56am
2
You should use a solid that fits best… or sphere because it’s fast and cheap.
name { type [flags] }
This entry indicates that geometry defined at this group level is
actually an invisible collision surface, and is not true geometry.
The geometry is used to define the extents of the collision
surface. If there is no geometry defined at this level, then a
child is searched for with the same collision type specified, and
its geometry is used to define the extent of the collision
surface (unless the "descend" flag is given; see below).
Valid types so far are:
Plane
The geometry represents an infinite plane. The first polygon
found in the group will define the plane.
Polygon
The geometry represents a single polygon. The first polygon is
used.
Polyset
The geometry represents a complex shape made up of several
polygons. This collision type should not be overused, as it
provides the least optimization benefit.
Sphere
The geometry represents a sphere. The vertices in the group are
averaged together to determine the sphere's center and radius.
InvSphere
The geometry represents an inverse sphere. This is the same as
Sphere, with the normal inverted, so that the solid part of an
inverse sphere is the entire world outside of it. Note that an
inverse sphere is in infinitely large solid with a finite hole
cut into it.
Tube
The geometry represents a tube. This is a cylinder-like shape
with hemispherical endcaps; it is sometimes called a capsule or
a lozenge in other packages. The smallest tube shape that will
fit around the vertices is used.
The flags may be any zero or more of:
event
Throws the name of the <Collide> entry, or the name of the
surface if the <Collide> entry has no name, as an event whenever
an avatar strikes the solid. This is the default if the
<Collide> entry has a name.
intangible
Rather than being a solid collision surface, the defined surface
represents a boundary. The name of the surface will be thrown
as an event when an avatar crosses into the interior, and
name-out will be thrown when an avater exits.
descend
Instead of creating only one collision object of the given type,
each group descended from this node that contains geometry will
define a new collision object of the given type. The event
name, if any, will also be inherited from the top node and
shared among all the collision objects.
keep
Don't discard the visible geometry after using it to define a
collision surface; create both an invisible collision surface
and the visible geometry.
level
Stores a special effective normal with the collision solid that
points up, regardless of the actual shape or orientation of the
solid. This can be used to allow an avatar to stand on a
sloping surface without having a tendency to slide downward.
{ type }
This is a short form to indicate one of several pre-canned sets of
attributes. Type may be any word, and a Config definition will be
searched for by the name "egg-object-type-word", where "word" is
the type word. This definition may contain any arbitrary egg
syntax to be parsed in at this group level.
A number of predefined ObjectType definitions are provided:
barrier
This is equivalent to <Collide> { Polyset descend }. The
geometry defined at this root and below defines an invisible
collision solid.
trigger
This is equivalent to <Collide> { Polyset descend intangible }.
The geometry defined at this root and below defines an invisible
trigger surface.
sphere
Equivalent to <Collide> { Sphere descend }. The geometry is
replaced with the smallest collision sphere that will enclose
it. Typically you model a sphere in polygons and put this flag
on it to create a collision sphere of the same size.
tube
Equivalent to <Collide> { Tube descend }. As in sphere, above,
but the geometry is replaced with a collision tube (a capsule).
Typically you will model a capsule or a cylinder in polygons.
bubble
Equivalent to <Collide> { Sphere keep descend }. A collision
bubble is placed around the geometry, which is otherwise
unchanged.
ghost
Equivalent to <Scalar> collide-mask { 0 }. It means that the
geometry beginning at this node and below should never be
collided with--characters will pass through it.
backstage
This has no equivalent; it is treated as a special case. It
means that the geometry at this node and below should not be
translated. This will normally be used on scale references and
other modeling tools.
More info here: CVS Info for project panda3d
and in the manual under collisions