Commit Graph
103 Commits
Author SHA1 Message Date
Goober5000 7c92dd9f7c hoist model_get and model_get_instance out of a bunch of functions 2020-12-16 11:55:31 -05:00
Baezon 27b388eb7f a whitespace change yes really because travis hates me 2020-11-20 12:02:13 -05:00
Baezon 76a1b557b9 review tweaks and copy paste errors 2020-11-20 12:02:13 -05:00
Baezon aa8849f4e5 improved warp collision 2020-11-20 12:02:13 -05:00
JohnAFernandez f21b1a7ace Multiplayer Resimulation for Client Fired Linear Weapons (Rollback) (#2788)
* Multiplayer Dumbfire Rollback

This creates a packet that sends the relative position and orientation info for a primary or dumbfire missle shot.  The client creates this packet when firing those two types of weapons and sends it to the server.  The server goes back to the frame that the client fired the weapon and quicky resimulates all the frames in-between.

This includes collision detection, restoring positions, orientations and veloicties, but not subsystem orientations.

* Address Feedback

* allow clients to send subsystem info

* Check for object number not weapon number

* Readability Adjustment
2020-11-03 22:56:25 -05:00
Goober5000 de0a9ca9c1 add Hitpos as a hook variable for all collision hooks
Also slightly optimizes some of the hooks because the adding/removing of hook variables should be guarded by the same if() block that controls execution.
2020-09-09 20:04:58 -04:00
asarium 2303785717 Improve scripting hook variable system
The previous system was kind of hacky and made things a bit inflexible.
This improves that system quite a bit and also adds unit tests for the
hook variable functionality.
2020-08-29 10:27:41 +02:00
Baezon f95f48448e world coords for all whacks 2020-07-27 01:11:00 -04:00
CasparKielwein b42fc2122a Cleanup in object collide code.
A bit of small cleanups in preparation of larger scale refactoring.

remove unused member heavy_collision_cm_pos of collision info struct,
which was set in several places but never used.
2019-05-01 09:44:19 +02:00
Goober5000 31fe15c4f4 remove hook variables immediately 2019-03-03 14:34:36 -05:00
Goober5000 c6bf5e927b make sure to set all hook variables when the script hook is called
In this block of code, the conditions were checked with a set of four hook variables but then subsequently run with only two.  This adds all four previously used variables.  More importantly, it adds the hook variables with expected and user-friendly names, since 'self' and 'object' are not necessarily intuitive.
2019-03-02 21:16:00 -05:00
asarium 8f4d51b14a Convert ade_get_args to variadic template based solution
This maintains the type information which can be used for enforce
const-correctness and also for implementing more advanced ways of
handling the type information.
2018-09-26 19:15:42 +02:00
Peter Mitsis 3b4fbde8e6 collide: Apply static keyword to applicable routines
Applying the 'static' keyword to applicable routines both informs the
developer where the routine is likely to be used as well as allows the
compiler to perform additional optimizations.

Signed-off-by: Peter Mitsis <[email protected]>
2018-04-14 19:57:04 -04:00
asarium 99f69c903e Add screen space decal rendering system
This allows to render screen space decals into the deferred lighting
buffers no matter how complex the underlying geometry is.

Currently there is only limited support for using this in the engine.
Only weapon impact decals are supported at the moment for testing
purposes.
2018-01-12 17:09:49 +01:00
z64555 f4b455dd98 Replace apply_damage_to_shield() with shield_apply_damage().
Also remove a declaration of shield_get_max_quad() in object.h
2016-11-25 15:12:09 -06:00
asarium 6dbf200cc3 Move lua to scripting folder 2016-10-03 21:38:29 +02:00
SamuelCho bb78e74646 Improved shields. Added shield decal rendering technique. Fixed inaccurate shield normals and shield collision detection timing. Bumped up shield impacts count to 200. 2016-08-28 15:36:10 -07:00
Fabian Woltermann 127976cd74 Weapon info flags conversion (#851) 2016-08-18 23:17:41 -07:00
Fabian Woltermann 770fce8de5 Bitset flags -- take 2 (#775)
This introduces a new mechanism for handling bit flags. Instead of using an int (or two, or three) to write bits into, this uses the std::bitset in a wrapper class that accepts an enum class as input. This means that certain classes of errors we've had a few of in the engine, where a coder used the wrong set of flags or checked them against the wrong variable (SF_STEALTH vs SIF_STEALTH, for example) can now be detected at a compiler level rather than not at all.
2016-08-12 16:13:50 -07:00
m!m 22c0255277 Fix a bunch of 64-bit MSVC warnings (#709)
* Fix a bunch of 64-bit warnings

* Fix Linux compilation error

* Fix Mac error

* Fix some issues

* Fix more GCC warnings

* Remote unwanted change

* Remove accidentally readded file

* Fix wrong limit check

* Use BEAM_INDEX macro for getting beam object index

* Fix 32-bit warning

* Use BEAM_INDEX instead of pointer arithmetic
2016-08-09 11:08:54 -07:00
asarium bbeaaa1565 Add a new particle effect system
This is similar to the script I wrote a few years ago but unlike that
one, this solution doesn't kill the performance.
2016-08-04 11:08:39 +02:00
MageKing17 f7591078b9 Change collisionInfo from an mc_info object to an mc_info* pointer.
This seems preferable to storing an entire mc_info object on every weapon, when the vast majority of projectiles (by the very nature of the fact that they still exist) won't have collided with anything.

On the other hand, I'm not wild about allocating and freeing memory every time a weapon collides with a ship or debris. If anyone has a better solution, I'm all ears.
2016-07-21 14:44:24 -07:00
The E a413255728 Renaming vm_vec_dotprod to vm_vec_dot 2015-12-01 20:35:47 +01:00
DahBlount 3e6fb113ee Deprecate +Min Damage and +Max Damage, add +Attenuation Damage: 2015-11-13 12:26:04 -07:00
asarium 559198a2e4 Fix format warning in collideshipweapon.cpp 2015-08-19 11:26:29 +02:00
Goober5000 bd3cd7eb18 Merge pull request #195 from Echelon9/fix/sort-uniq-includes
Review and refactor #include's
2015-08-19 00:05:02 -04:00
Lari Nieminen 1bf86532fe Added $Collision LOD ship table property, for using a LOD for collision detection 2015-08-03 13:20:14 +03:00
Lari Nieminen cacad0ba70 Fixed possibility of +Minimum Weapon Span breaking with modular tables. 2015-07-25 01:14:03 +03:00
Lari Nieminen 7b2c992380 Added a +Minimum Weapon Span auto spread shield option to control the minimum distance weapons must have traveled before being allowed to hit the shield. 2015-07-21 21:59:31 +03:00
Echelon9 1e151865d4 Fix: object/collideshipweapon.cpp:67:185: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:45:38 +10:00
Echelon9 c2a2ef5682 Fix: object/collideshipweapon.cpp:39:63: warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow] 2015-07-06 23:42:15 +10:00
Echelon9 2c4fb4286c Fix: object/collideshipweapon.cpp:470:10: warning: declaration of ‘weapon’ shadows a global declaration [-Wshadow] 2015-07-05 16:19:20 +10:00
Echelon9 b326e77574 Fix: object/collideshipweapon.cpp:543:85: warning: declaration of ‘weapon’ shadows a global declaration [-Wshadow] 2015-07-05 15:55:15 +10:00
Echelon9 29faabdfb3 Simplify duplicative object/ includes. 2015-06-22 20:24:31 +10:00
Echelon9 c5493bb480 Scripted sort and uniq on (internal) project includes. Improves search time and as a by product removed a number of duplicative includes. 2015-06-22 20:24:30 +10:00
Fabian Woltermann f6d0e7d97a Merge pull request #126 from AxemP/PainFlash
Adding customizable pain flash and shield pain flash settings
2015-06-13 15:22:40 +02:00
DahBlount 5f63e86dde Add sanity checks and an extra parameter
This adds extra sanity checks to the Weapon Damage Decay code and also
adds a new parameter for weapons that can GAIN damage is they approach
the end of their lifetime.
2015-06-12 09:56:13 -07:00
DahBlount e8f58f5947 Create Weapon Damage Decay framework
This adds the $Daamge Time: and +Min Damage: entries to weapons.tbl.
These parameters are used to create damage attenuation for non-beam primary weapon.
2015-06-12 05:01:21 -07:00
Lari Nieminen 3e4cfa361d Added customizable shield impact explosion effects, originally adapted from Wanderer branch. 2015-05-27 13:41:50 +03:00
Axem e396686570 Adding customizable pain flash and shield pain flash settings 2015-05-24 09:00:30 -05:00
Lari Nieminen 91000b4468 Revert "Fixed +Spread From LOD not working right."
This reverts commit 4b15ec4e75.
2015-04-29 22:41:17 +03:00
zookeeper 4b15ec4e75 Fixed +Spread From LOD not working right.
git-svn-id: svn://svn.icculus.org/fs2open/branches/zookeeper@11268 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 22:36:43 +03:00
m_m 9689711149 From FUBAR-BDHR, chief1983, m!m and MageKing17: Fix for Mantis 2887: Additional workaround for mantis 2693
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10969 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:34 +10:00
Echelon9 3f645215ad Address clang warning - object/collideshipweapon.cpp:258:17: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10877 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
zookeeper edc515e681 Fixed Mantis #3037; surface shields will again check for a shield mesh collision before hull collision.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10618 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:35 +10:00
zookeeper a72f0f9d62 Allowed the $Weapon class hook condition to work on $Weapon Collision hooks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10430 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
zookeeper 7f74ce48a6 Fixed +Spread From LOD not working.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10290 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper 8cd19aa588 Merged model point shields from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10135 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
zookeeper 3df8818635 Fixed subtle breakage I caused to surface shields in r9794.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9993 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
The_E ea6edd3f8c Catch a rare error condition where shield_hit_tri was -1 for some reason
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9927 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00