2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Headers for physics functions and data
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _PHYSICS_H
|
|
|
|
#define _PHYSICS_H
|
|
|
|
|
|
|
|
#include "vecmat.h"
|
|
|
|
#include "fvi.h"
|
2016-12-24 08:50:29 +00:00
|
|
|
#include "fwd-window.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
//#define FL_NORMAL 0
|
|
|
|
//#define FL_TURBO 1
|
|
|
|
//#define FL_HOVER 2
|
|
|
|
//#define FL_REVERSE 3
|
|
|
|
|
|
|
|
// these global vars are set after a call to do_physics_sim(). Ugly, I know.
|
|
|
|
// list of segments went through
|
2015-04-02 02:36:52 +00:00
|
|
|
extern unsigned n_phys_segs;
|
2015-04-11 04:01:29 +00:00
|
|
|
extern array<segnum_t, MAX_FVI_SEGS> phys_seglist;
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// Simulate a physics object for this frame
|
2015-11-26 02:56:55 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
|
2016-08-25 04:05:32 +00:00
|
|
|
#ifdef dsx
|
|
|
|
namespace dsx {
|
2017-06-10 03:31:02 +00:00
|
|
|
window_event_result do_physics_sim(vmobjptridx_t obj);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-08-25 04:05:32 +00:00
|
|
|
}
|
|
|
|
#endif
|
2016-04-06 03:34:14 +00:00
|
|
|
namespace dcx {
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
// Applies an instantaneous force on an object, resulting in an instantaneous
|
|
|
|
// change in velocity.
|
2016-04-06 03:34:14 +00:00
|
|
|
void phys_apply_force(object_base &obj, const vms_vector &force_vec);
|
|
|
|
|
|
|
|
}
|
2016-04-06 03:34:14 +00:00
|
|
|
namespace dsx {
|
|
|
|
void phys_apply_rot(object &obj, const vms_vector &force_vec);
|
|
|
|
}
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// this routine will set the thrust for an object to a value that will
|
|
|
|
// (hopefully) maintain the object's current velocity
|
2016-07-15 03:43:01 +00:00
|
|
|
namespace dcx {
|
|
|
|
void set_thrust_from_velocity(object_base &obj);
|
|
|
|
}
|
2014-11-04 01:30:49 +00:00
|
|
|
void check_and_fix_matrix(vms_matrix &m);
|
2016-04-06 03:34:14 +00:00
|
|
|
namespace dcx {
|
|
|
|
void physics_turn_towards_vector(const vms_vector &goal_vector, object_base &obj, fix rate);
|
|
|
|
}
|
2015-11-26 02:56:55 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
#endif /* _PHYSICS_H */
|