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, 05:48 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Issue with applyForceOffset
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.
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.