⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ivp_surman_polygon.hxx

📁 hl2 source code. Do not use it illegal.
💻 HXX
字号:
// Copyright (C) Ipion Software GmbH 1999-2000. All rights reserved.

// IVP_EXPORT_PUBLIC

/********************************************************************************
 *  Filename:	    ivp_surman_polygon.hxx
 *  Description:    This file provides you with an interface class to the compact
 *		    surface of any polygonal object. This class is vital to 
 *		    generate physical objects.
 *  Classes:	    IVP_SurfaceManager_Polygon
 ********************************************************************************/

#ifndef _IVP_SURMAN_POLYGON_INCLUDED
#define _IVP_SURMAN_POLYGON_INCLUDED

#ifndef WIN32
#	pragma interface
#endif

class IVP_Compact_Surface;
class IVP_Compact_Ledgetree_Node;

/********************************************************************************
 *  Class:	    IVP_SurfaceManager_Polygon
 *  Description:    A subclass of the basic IVP_SurfaceManager class. Used for
 *		    polygonal objects in general. This is sort of an interface
 *		    to the compact surface (geometrical topology) and some of its
 *		    basic values.
 *  Note:	    Use these methods instead of directly accessing the compact
 *		    surface!
 *******************************************************************************/

class IVP_SurfaceManager_Polygon : public IVP_SurfaceManager {    
protected:
    IVP_SurfaceManager_Polygon();
    // internal methods & data
    const IVP_Compact_Surface *compact_surface;	// should be constructed using ivp_malloc_aligned
public:

    /******************************************************************************
     *  Description:    INTERNAL METHODS
     *****************************************************************************/
    void add_reference_to_ledge(const IVP_Compact_Ledge *ledge);
    void remove_reference_to_ledge(const IVP_Compact_Ledge *ledge);
    void insert_all_ledges_hitting_ray(IVP_Ray_Solver *ray_solver, IVP_Real_Object *object);
    void get_radius_and_radius_dev_to_given_center(const IVP_U_Float_Point *center, IVP_FLOAT *radius, IVP_FLOAT *radius_deviation) const;
    virtual IVP_SURMAN_TYPE get_type();


    /******************************************************************************
     *  Method:		is_single_convex
     *	Output:		Returns the ledge if compact surface consists of exactly
     *			one (convex) ledge.
     *	Note:		If the compact surface is concave, but consists of two
     *			or more (convex) ledges (e.g. a cube made out of four
     *			subcubed) this method will return NULL!
     *****************************************************************************/
    virtual const IVP_Compact_Ledge *get_single_convex() const;

    /******************************************************************************
     *  Method:		get_mass_center
     *	Output:		sets the compact surface's mass center
     *****************************************************************************/
    void get_mass_center(IVP_U_Float_Point *mass_center_out) const;

    /******************************************************************************
     *  Method:		get_rotation_inertia
     *	Description:	Returns the compact surface's rotation inertia
     *	Input:		<rotation_inertia_out> vector to be filled with inertia
     *****************************************************************************/
    void get_rotation_inertia(IVP_U_Float_Point *rotation_inertia_out) const;

    /******************************************************************************
     *  Method:		get_all_ledges_within_radius
     *	Description:	Fills a supplied vector with all of the compact surface's
     *			(convex) ledges which are within a certain radius around
     *			a given center point.
     *	Input:		<root_ledge>	   for recursive compact ledges start search
     *					   at 'root_ledge'
     *			<observer_os>      center point of observation (in compact
     *					   surface coordinate system!)
     *			<radius>           radius to check
     *			<resulting_ledges> vector to be filled with ledges
     *****************************************************************************/
    void get_all_ledges_within_radius(const IVP_U_Point *observer_os, IVP_DOUBLE radius,
				      const IVP_Compact_Ledge *root_ledge, IVP_Real_Object *other_object, const IVP_Compact_Ledge *other_reference_ledge,
				      IVP_U_BigVector<IVP_Compact_Ledge> *resulting_ledges);
    void get_all_terminal_ledges(IVP_U_BigVector<IVP_Compact_Ledge> *resulting_ledges);

    /******************************************************************************
     *  Method:		get_compact_surface
     *	Output:		Returns a pointer to the surface manager's compact surface
     *****************************************************************************/
    const IVP_Compact_Surface *get_compact_surface() const { return(this->compact_surface); }

    /******************************************************************************
     *  Method:		constructor
     *	Description:	Simply initializes the surface manager with the supplied
     *			compact surface.
     *	Input:		<compact_surface_in> compact surface to initilize the
     *			                     surface manager with
     *****************************************************************************/
    IVP_SurfaceManager_Polygon(const IVP_Compact_Surface *compact_surface_in) { this->compact_surface = compact_surface_in; }

    virtual ~IVP_SurfaceManager_Polygon();

};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -