113 lines
4.5 KiB
Plaintext
113 lines
4.5 KiB
Plaintext
// Filename: collisionVisualizer.I
|
|
// Created by: drose (17Apr03)
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
//
|
|
// PANDA 3D SOFTWARE
|
|
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
|
|
//
|
|
// All use of this software is subject to the terms of the Panda 3d
|
|
// Software license. You should have received a copy of this license
|
|
// along with this source code; you will also find a current copy of
|
|
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
|
|
//
|
|
// To contact the maintainers of this program write to
|
|
// panda3d-general@lists.sourceforge.net .
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: CollisionVisualizer::SolidInfo::Constructor
|
|
// Access: Public
|
|
// Description:
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE CollisionVisualizer::SolidInfo::
|
|
SolidInfo() {
|
|
_detected_count = 0;
|
|
_missed_count = 0;
|
|
}
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: CollisionVisualizer::set_point_scale
|
|
// Access: Published
|
|
// Description: Scales the points that are drawn to represent the
|
|
// surface and interior intersection points of the
|
|
// collisions. By default, these objects are drawn at
|
|
// an arbitrary scale which is appropriate if the window
|
|
// units are the default range -1 .. 1. Change this
|
|
// scale accordinatly if the window units are measured
|
|
// on some other scale or if you need to observe these
|
|
// objects in a smaller window.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void CollisionVisualizer::
|
|
set_point_scale(float point_scale) {
|
|
_point_scale = point_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: CollisionVisualizer::get_point_scale
|
|
// Access: Published
|
|
// Description: Returns the value last set by set_point_scale().
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE float CollisionVisualizer::
|
|
get_point_scale() const {
|
|
return _point_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: CollisionVisualizer::set_normal_scale
|
|
// Access: Published
|
|
// Description: Scales the line segments that are drawn to represent
|
|
// the normals of the collisions. By default, these
|
|
// objects are drawn at an arbitrary scale which is
|
|
// appropriate if the scene units are measured in feet.
|
|
// Change this scale accordinatly if the scene units are
|
|
// measured on some other scale or if you need to
|
|
// observe these normals from farther away.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void CollisionVisualizer::
|
|
set_normal_scale(float normal_scale) {
|
|
_normal_scale = normal_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: CollisionVisualizer::get_normal_scale
|
|
// Access: Published
|
|
// Description: Returns the value last set by set_normal_scale().
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE float CollisionVisualizer::
|
|
get_normal_scale() const {
|
|
return _normal_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: CollisionVisualizer::as_typed_object
|
|
// Access: Public
|
|
// Description: This is provided to disambiguate the typecast to
|
|
// TypedObject, since we have two TypedObjects in our
|
|
// inheritance chain.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE TypedObject *CollisionVisualizer::
|
|
as_typed_object() {
|
|
// In fact, it really doesn't matter which one we pick. Arbitrarily
|
|
// pick the one that goes through PandaNode.
|
|
return PandaNode::as_typed_object();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function: CollisionVisualizer::as_typed_object
|
|
// Access: Public
|
|
// Description: This is provided to disambiguate the typecast to
|
|
// TypedObject, since we have two TypedObjects in our
|
|
// inheritance chain.
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE const TypedObject * CollisionVisualizer::
|
|
as_typed_object() const {
|
|
// In fact, it really doesn't matter which one we pick. Arbitrarily
|
|
// pick the one that goes through PandaNode.
|
|
return PandaNode::as_typed_object();
|
|
}
|
|
|