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

📄 ivp_real_object.hxx

📁 hl2 source code. Do not use it illegal.
💻 HXX
📖 第 1 页 / 共 2 页
字号:
    void reset_time( IVP_Time offset);

    void revive_object_for_simulation(); // wake up object immediately ; @@@IK don't use this - use ensure_in_simulation() instead!
    
    IVP_SurfaceManager     *get_surface_manager()const { return surface_manager; }
    IVP_OV_Element	   *get_ov_element(){ return ov_element; }

    void set_movement_state(IVP_Movement_Type mt) { flags.object_movement_state = mt; };

    IVP_FLOAT get_extra_radius() const { return extra_radius; };	// returns an extra collision radius around the object#
	void set_extra_radius( IVP_DOUBLE new_radius );
	inline IVP_Cache_Object *get_cache_object_no_lock(); // see get_cache_object, but restricted usage


    IVP_Real_Object *to_nonconst() const { return (IVP_Real_Object *)this; }; // remove const
/********************************************************************************
 *	The real end user public section:
 ********************************************************************************/
    
    void *client_data; //not used by physics, provided for customer

    
    /********************************************************************************
	 *	Name:	    	get_cache_object 	
	 *	Description:	Get a matrix that allows to transform between object and
	 *			world space. It also locks the cache element.
	 *			To unlock, call IVP_Cache_Object::remove_reference().
	 *	Note:		Include ivp_cache_object.hxx to use this method.
	 ********************************************************************************/
    inline IVP_Cache_Object *get_cache_object();

     /*************************************************************************************
	 *	Name:	    	set_new_surface_manager 	
	 *	Descripion:	sets a new geometry for this object
	 *      Note:           does not update rotation inertias etc..
	 ************************************************************************************/
    void set_new_surface_manager( IVP_SurfaceManager *);

     /*************************************************************************************
	 *	Name:	    	recalc_core_radius 	
	 *	Descripion:	updates the upper_limit_radius stored in the core
	 ************************************************************************************/
	void recalc_core_radius();

	/*************************************************************************************
	 *	Name:	    	get_geom_xxx 	
	 *	Note:		Geometric center/radius is not the same as mass center/radius!
	 ************************************************************************************/
    void get_geom_center_world_space(IVP_U_Point *center_ws_out) const;
    IVP_FLOAT get_geom_radius() const; 	// [m]
    IVP_FLOAT get_geom_center_speed() const; 	// [m/s]
    void get_geom_center_speed_vec(IVP_U_Point *speed_ws_out) const; // [m/s]

    
        /***********************************************************************************
	 *	Name:	    	calc_at_matrix 	
	 *	Description:	Get the object's matrix for the display engine at Any Time (at).
	 *	Note:		The matrix is an interpolation of two PSI matrizes.
	 **********************************************************************************/
    void calc_at_matrix(IVP_Time current_time_in, IVP_U_Matrix   *m_world_f_object_out ) const;
    void calc_at_quaternion(IVP_Time current_time_in, IVP_U_Quat *q_world_f_object_out, IVP_U_Point *position_ws_out) const;

        /***********************************************************************************
	 *	Name:	    	beam_object_to_new_position 	
	 *	Description:	Set the object's matrix
	 *      Parameter:      rotation:   the new rotation
	 *                      position:   the new position
	 *                      optimize_for_repeated_calls: set to true if you are planning
	 *                      to call this function every frame
	 *	Attention:	If the objects penetrates other objects at the new position,
	 *                      no collisions will be generated !!!
	 **********************************************************************************/
    void beam_object_to_new_position( const IVP_U_Quat *rotation, const IVP_U_Point *position, IVP_BOOL optimize_for_repeated_calls = IVP_FALSE);

    
        /****************************************************************************************************
	 *	Name:	    	get_m_world_f_object_AT 	
	 *	Description:	Same as calc_at_matrix but point of time is taken from environment.
	 *	Note:		Implementation looks like:
	 *			'calc_at_matrix(get_environment()->get_current_time(), m_world_f_object_out);'
	 ****************************************************************************************************/
    void   get_m_world_f_object_AT   (IVP_U_Matrix *m_world_f_object_out) const;
    void   get_quat_world_f_object_AT(IVP_U_Quat *quat_world_f_object, IVP_U_Point *position) const; // ditto (using quaternions)

    
        /**************************************************************************************
	 *	Name:	    	calc_m_core_f_object 	
	 *	Description:	Calculates a matrix to transform between core and object space.
	 **************************************************************************************/
    void   calc_m_core_f_object(IVP_U_Matrix * m_core_f_object);

    IVP_Core *get_core()	  const { return physical_core;}; // Returns the current core. 
    IVP_Core *get_original_core() const { return original_core; }; // Returns the core that was valid at creation of object.
    
    IVP_Movement_Type get_movement_state() { return (IVP_Movement_Type)flags.object_movement_state; }; // See declaration of IVP_Movement_Type.

    
    //////// Simulation
    IVP_BOOL disable_simulation();          // Freeze object immediately disregarding the speed, return IVP_TRUE when success
    void ensure_in_simulation(); 	// Frozen object is woken up in next PSI (fast).
    void ensure_in_simulation_now(); 	// Wakes up object immediately (slower).


    /////// Collision Detection
    void enable_collision_detection(IVP_BOOL enable = IVP_TRUE);
    int get_collision_check_reference_count(); // see IVP_Universe_Manager for details

    
        /********************************************************************************
	 *	Name:	    	async_add_speed_object_ws and async_add_rot_speed_object_cs	
	 *	Description: 	Easy to use functions used to specify speed and rotation speed
	 *			changes of an object at any time.
	 *	Side Effects:	Object is woken up.
	 *			The speed changes are committed at next PSI.
	 ********************************************************************************/
    void async_push_object_ws( const IVP_U_Point *position_ws, const IVP_U_Float_Point *impulse_ws); // impulse vec's length = impulse strength [kg*m/s]
    void async_add_speed_object_ws( const IVP_U_Float_Point *speed_ws );	   // add a value to the core's speed_change variable
    void async_add_rot_speed_object_cs( const IVP_U_Float_Point *rotation_vec_cs ); // add a value to the core's rot_speed_change variable
    
    IVP_BOOL is_collision_detection_enabled() { // Returns IVP_FALSE if IVP_Environment::enable_collision_detection was not called
	return (IVP_BOOL)flags.collision_detection_enabled;
    };

    /////// Listening
    void add_listener_collision(IVP_Listener_Collision *);	// Adds a private collision callback.
    void remove_listener_collision(IVP_Listener_Collision *);	// Removes a private collision callback.

    void add_listener_object(IVP_Listener_Object *);	        // Adds an private object callback.
    void remove_listener_object(IVP_Listener_Object *);	        // Removes a private object callback.


        /**************************************************************************************
	 *	Name:	    	set_motion_controller 	
	 *	Description:	Specifies an external motion controller.
	 * 			Overrides any existing motion controller for this object.
	 * 			NULL removes controller.
	 *      Version info:   use IVP_Real_Object::create_controller_motion to get same functionality
	 **************************************************************************************/

    void convert_to_phantom(const IVP_Template_Phantom  *tmpl);
    IVP_Controller_Phantom *get_controller_phantom(){ return controller_phantom; };

    
        /**************************************************************************************
	 *	Name:	    	recheck_collision_filter 	
	 *	Description:	to be called when the collisionfilter has a new behaviour
	 **************************************************************************************/
    void recheck_collision_filter();

    /**************************************************************************************
	 *	Name:	    	do_radar_checking 	
	 *	Description:	Checks vicinity for objects
	 * 			that can possibly collide with this object, 
	 *	Version Info:   High optimization of the collision detection engine
	 *                  made this routine finding only very nearby objects
	 **************************************************************************************/
    void do_radar_checking(IVP_Radar *radar);

    
        /**************************************************************************************
	 *	Name:	    	delete_and_check_vicinity 	
	 *	Description:	deletes object and revives surroundings
	 **************************************************************************************/
    void delete_and_check_vicinity();

    
        /**************************************************************************************
	 *	Name:	    	delete_silently 	
	 *	Description:	Silently deletes object, vicinity will stay frozen
	 **************************************************************************************/
    void delete_silently();    

    /**************************************************************************************
     *	   Change on the fly section
     *	   Some physical values can be changed on the fly
     *     Be sure to call recompile_values_changed after changing
     *     Materials can be changed too (directly)
     *     Call recompile_material_changed after material was changed
     **************************************************************************************/
    void change_mass(IVP_FLOAT new_mass); //changes rot_inertia too
    void change_unmovable_flag( IVP_BOOL unmovable_flag );
    void change_fast_piling_allowed(IVP_BOOL flag);
	void set_pinned(IVP_BOOL is_pinned); //@@CB
    
    void change_nocoll_group_ident(const char *new_identify_string ); // note: max length IVP_NO_COLL_GROUP_STRING_LEN
    
    void recompile_values_changed();
    void recompile_material_changed();
};

#endif

⌨️ 快捷键说明

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