Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Help and Support v
« Previous 1 … 15 16 17 18 19 … 21 Next »
Issue with applyForceOffset
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
Issue with applyForceOffset
29-04-2015, 06:39 PM, (This post was last modified: 29-04-2015, 06:43 PM by LocInt.)
#3
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: Issue with applyForceOffset
(29-04-2015, 05:48 PM)Person8880 Wrote: You're getting the normalised version of a zero vector, i.e dividing by 0.

Somewhere in the torque code there's
off = off:GetNormal() * torqueamount * 0.5

local dir = ( tq:Cross( off ) ):GetNormal()
If off is the zero vector, or tq and off are the same vector (which causes the cross product to return the zero vector) you end up with nan, nan, nan. There's also the case of where tq is the zero vector which will also cause the problem.

Basically, check for:
if torqueamount == 0 then return end
-- carry on...

EDIT: Had more than a 2 second look. The only way you'd end up with 0 magnitude vectors below is if your input is zero. So just check for zero torque.

Want to explain why this started to happen just now not before? Seriously I don't have time to fix all my code everyday. Sorry for being so rude but I feel like fixing all my chips always when I come online.

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Issue with applyForceOffset - by LocInt - 28-04-2015, 10:02 PM
RE: Issue with applyForceOffset - by Person8880 - 29-04-2015, 05:48 PM
RE: Issue with applyForceOffset - by LocInt - 29-04-2015, 06:39 PM
RE: Issue with applyForceOffset - by Person8880 - 29-04-2015, 06:44 PM
RE: Issue with applyForceOffset - by LocInt - 29-04-2015, 06:45 PM
RE: Issue with applyForceOffset - by Person8880 - 29-04-2015, 06:52 PM
RE: Issue with applyForceOffset - by LocInt - 04-05-2015, 01:46 AM
RE: Issue with applyForceOffset - by Person8880 - 04-05-2015, 09:08 AM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.