Commit Graph

155 Commits

Author SHA1 Message Date
hikerstk
72070db1a0 Fixed memory leak: the virtual createPhysics function of
GhostKart was not called, since it was called during when
the contrsuctor of Kart was executed (at this time the
GhostKart vtable wasn't set up, so Kart::createPhysics)
was called - which resulted in a memory leak since all
physics parts of the kart were actually allocated (just
not used). To fix this, karts are not constructed in two
phases: first a constructor, followed by a call to init
(during which virtual function can be used).
Fixed several bugs were physics data for a GhostKart
were accessed.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10947 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-03-07 02:41:41 +00:00
hikerstk
650af20260 Fixed #550: zippers have much less effect.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10909 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-02-29 09:10:16 +00:00
hikerstk
5feea5c8f2 Fixed byg and naming inconsistencies in kart pushing, more
tuning towards collision impulse.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10875 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-02-19 21:41:54 +00:00
hikerstk
1698d1dfe5 Removed unused function.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10872 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-02-17 11:53:29 +00:00
hikerstk
5535564467 Consider the 'sideway' speed with which karts hit each other: this makes
it possible to intentionally push karts off track by crashing into them
sideways. This is experimental ;)
Also renamed some variables to better describe what they are.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10830 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-02-09 05:41:13 +00:00
hikerstk
90e6a02193 Improved collision handling to better detect left/right side
collisions. Made collisions more bouncy than before (but I am
still tuning).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10827 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-02-08 20:22:00 +00:00
hikerstk
9d5485a9e3 1) Moved attachment handling from physics to attachment.
2) Split Kart::crashed into two public functions for collisions with
   kart and collisions with track, and one private function with code
   common to both collisions.
3) Removed #include of attachment.hpp from kart.hpp to reduce compile
   time.
Sorry for not splitting this up into three parts.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10775 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-31 12:02:10 +00:00
hikerstk
fd4eb3fa5e Added comment.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10707 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-23 06:06:17 +00:00
hikerstk
0836380d9e Apply the additional rotation to be applied to a body also
to the interpolated world transform. This fixes a bug for
rotations that are applied only once, since kart.cpp would
use the interpolated world transform, which is otherwise
not updated till the next time step, resulting in a jump
of the kart rotation.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10706 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-23 05:37:21 +00:00
hikerstk
79e2b7d0ae More work on skidding (still disabled by default).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10686 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-16 21:52:47 +00:00
hikerstk
ee88af76b9 1) Added adjustment of rotation of chassis after skidding.
2) Renamed setTimedImpulse to setTimedCentralImpulse.
New skidding is still disabled.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10652 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-12 00:09:04 +00:00
auria
a2e9db2ae5 Disable quantization to improve load times, thanks Joerg for the idea (oops, I'd changed the wrong one ^^)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10615 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-09 00:45:03 +00:00
auria
f230855b3d Disable quantization to improve load times, thanks Joerg for the idea
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10614 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-09 00:35:15 +00:00
auria
b6601d1aaf Add missing \n in previous commit
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10587 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-07 23:12:23 +00:00
auria
d731420997 Improve error handling
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10586 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-07 23:07:37 +00:00
auria
ca4da84bae remove useless assert
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10585 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-07 23:06:10 +00:00
auria
06d9359fa6 Add experimental code to load bullet mesh BVH from serialized file instead of calculating it on the fly, making it quite a bit faster
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10583 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-07 22:06:40 +00:00
hikerstk
e06c8a05fa Split updatePhysics into several shorter functions to make the code easier to
understand. Removed and simplified some functions. This should not change
anything in actual game play.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10574 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-04 21:58:33 +00:00
hikerstk
87865b7dec Removed unnecessary include of kart.hpp from world.hpp.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10572 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-04 05:32:19 +00:00
hikerstk
7e59d027c5 Minor code simplification.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10571 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-04 05:28:16 +00:00
hikerstk
a720994036 Fixed #539 (elephpant has problems with wheels when using convex hull
as collision shape). This appears to be a bullet problem (raycast for
wheels is hitting the chassis), worked around this by disabling
raycast collisions with chassis completely.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10556 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2012-01-03 00:29:34 +00:00
hikerstk
c3586684d3 Cosmetic changes only.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10451 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-19 22:02:48 +00:00
hikerstk
c3a057f206 Added options to apply an impulse for a certain amount of time. This
way pushing two karts away from each other is less abrupt. This is
now enabled, feedback (or tweaks) welcome.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10439 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-18 20:55:27 +00:00
hikerstk
2920a5a126 Some code cleanup. Removed tabs, fixed layout. Removed
unnecessary code, change some defaults to reduce number
of calls from STK.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10423 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-15 06:16:33 +00:00
hikerstk
d06acf1f7b 1) Added an (additional) impulse to push karts away from each other.
This impulse does not cause any rotation of the kart, it just pushes
the kart orthogonal to its velocity.
2) The rotational velocity is set to 0 in case of a collision, hopefully
avoiding the problem that karts will rotate as result of a collision.
3) A collision pair now stores the exact collision point for both bodies
(which is then used to determine the side in which the impulse to be
applied).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10422 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-14 21:02:15 +00:00
hikerstk
8ab469d4d8 1) Added an additional impulse to push karts away in case of a collision (unused atm)
2) Saved one collision point for each collision pair so that a frontal detection
   can be detected (atm unused).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10407 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-12 05:42:40 +00:00
auria
92eb0ebd2a Ran a small bash script to remove all of those annoying strings. The only thing they gave us were the need to rebuild after committing
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10363 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-06 18:43:36 +00:00
hikerstk
964d132364 Added code for skidding (currently disabled, so no visible change).
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10361 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-06 05:54:16 +00:00
hikerstk
bb6e9f6f2c Replaced tabs.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10295 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-01 11:33:37 +00:00
hikerstk
52fca10f14 Tried to fix linking problems by moving some code into
class functions.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10293 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-01 02:41:18 +00:00
hikerstk
2c33ed75ed Merged the physics branch back to trunk. There should be no change at
this stage for users.
The physics branch added a few new stability options (which are disabled
by default), fixed bug and reproducing history files when using physics
replay, using --log=file command line option. See log on the physics
branch for full details.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10292 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-12-01 01:14:10 +00:00
hikerstk
44eec35a43 Removed translating the mesh (if graphical mesh and bullet collision body
are not the same). Instead the difference between the mesh and the body
is applied before setting the new location in update. 
Also fixed some minor line length issues.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10051 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-27 01:07:10 +00:00
hikerstk
da80f39ed4 Removed patched 10044 to 10047, since there is a much
easier patch to fix #458.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10050 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-27 01:04:16 +00:00
hikerstk
1099f3aa69 Make sure that no debug drawing happens if debug mode is disabled
(turns out that besides out explicit calls to debug drawing bullet
includes additional calls, and they were still executed even if
debug was disabled).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10048 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-26 21:17:24 +00:00
auria
953e8cf1ef Almost fix Nolok wheel issue in 3 strikes mode. Note, my fix is not complete and will result in segfaults in 3 strikes mode
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10044 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-26 15:18:46 +00:00
auria
d04bc58413 Quite a bit of work on Doxygen docs to contain an overview of the STK source code base
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10039 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-25 17:46:14 +00:00
hikerstk
9abcc41d52 Fixed memory leak each time a track with graphical surface effect
(water) is being used.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9950 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-06 22:22:29 +00:00
auria
7111b83a63 Add sanity checks
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9928 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-10-03 02:11:47 +00:00
auria
fa4bbcb3a2 Fixed uninitialized variables
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9925 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-30 22:26:00 +00:00
hikerstk
a354f5521d Added support for animated physical objects to trigger a reset
of a kart on collision.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9924 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-30 06:29:00 +00:00
hikerstk
2b805c7d69 Added support for physical objects triggering rescue on collision
(#163). Objects must be declared with 'reset="Y"' in order
to trigger rescue.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9910 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-28 10:52:41 +00:00
hikerstk
3e32b840bf Only cosmetic changes to adjust the files to our coding style.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9909 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-28 05:19:22 +00:00
auria
b7b1c02bb0 On forum, with minigolf course, it was suggested that it would be cool to be able to use more accurate collision shapes, for instance enabling the windmill to hit the kart. I agree, and bullet can do that, so it's not possible :) but not used anywhere atm
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9867 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-18 19:53:02 +00:00
hikerstk
cb08a03d7d Removed compiler warnings.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9710 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-02 01:34:08 +00:00
auria
3e7aeaf71f HAving some fun : you will now physically lose a tire in 3-strikes mode. Watch out for tires all over the place as the battle gets fierce ;)
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9703 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-09-01 20:09:26 +00:00
hikerstk
2a542f011a Fixed comment.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9605 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-22 01:09:09 +00:00
auria
f8dcf186ef Fixed rotation of movable objects
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9578 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-08-20 19:56:48 +00:00
hikerstk
da8ec214ce Added a very first version of a swatter (or inflatable hammer).
Details are in the wiki (http://supertuxkart.sourceforge.net/Items).
Note that the model is _obviously_ a placeholder, and I  used
the icon for the bomb (which isn't used in game atm) for the
swatter. I hope someone can provide a better model and icon.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9011 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-06-22 12:27:48 +00:00
hikerstk
9b64fa1406 1) Added new isInvulnerable function to kart, which is now
also used by emergency animation to make a kart invulnerable
   for a certain amount of time.
2) Karts are not not affected anymore by a explosion that
   just happens close by, see #258.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8814 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-06-04 13:29:35 +00:00
hikerstk
13c166eae5 Added asserts to bullet calls to catch NANs early on.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8781 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2011-05-30 06:57:23 +00:00