Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Subject: Cameras
Subject: scaleDown command
Subject: black out solved
Subject: Aircraft Tutorial
Subject: Mathematical XYZ ?
Subject: Re: Its done This vs That
Subject: Re: Its done first week
recommendations for screen video captures?
Subject: 3DExplorer "Oddity "
Subject: Re: New Director
Subject: ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
Subject: RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Subject: Re: Texturing
Big Break Contest Videos
Subject: New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Subject: Plasma?
Looking for Inspiration
Subject: Weird EMail Q
Subject: Re: It 's done first week ?
Subject: Cherry not cranberry
Subject: Re: New game
Camera Animation Problem
Subject: Particle plugins?
 
Subject: collision question

Subject: collision question

2004-03-30       - By welchc@(protected)

 Back
Reply:     1     2  


I've been trying to tackle this issue also. I am trying to avoid using the
built in collision code because its slow as hell. I've found that casting a
ray is much faster, bet I'm still having some issues. Here's some code I
came up will that kinda works. I would like to compress it though. Its
seems redundant. Also, sometimes it works and sometimes it doesn't. Help
anyone?

On checkforCollision

--Boundry Management
 boundaryWall = scene.model("walkabout_areaShape")

 targetpos = scene.model("target").getworldtransform().position

 if keypressed(123) then -- 123 = left arrow key

   modelsListN = scene.modelsunderray(vector(-3, targetpos.Y, targetpos.Z
), vector(1.0001,0.0001,0.0001), #detailed)
   whichmodel = void
   totalmodels = modelsListN.count
   repeat with x = 1 to totalmodels
     if modelsListN[x].model = scene.model("walkabout_areaShape") then
       put modelsListN[x].model.name && "hit"
     else
       put "left"
       pCharacter.translate(TheSpeed,0,0)
     end if
   end repeat
 end if

 if keypressed(124) then -- 124 = right arrow key

   modelsListS = scene.modelsunderray(vector(3, targetpos.Y, targetpos.Z),
vector(-1.0001,0.0001,0.0001), #detailed)
   whichmodel = void
   totalmodels = modelsListS.count
   repeat with x = 1 to totalmodels
     if modelsListS[x].model = boundaryWall then
       put modelsListS[x].model.name && "hit"
     else
       put "right"
       pCharacter.translate(-TheSpeed,0,0)
     end if
   end repeat
 end if

 if keypressed(125) then -- 125 = down arrow key

   modelsListE = scene.modelsunderray(vector(targetpos.X, -3, targetpos.Z
), vector(0.0001,1.0001,0.0001), #detailed)
   whichmodel = void
   totalmodels = modelsListE.count
   repeat with x = 1 to totalmodels
     if modelsListE[x].model = boundaryWall then
       put modelsListE[x].model.name && "hit"
     else
       put "down"
       pCharacter.translate(0,TheSpeed,0)
     end if
   end repeat
 end if


 if keypressed(126) then-- 126 = up arrow key

   modelsListW = scene.modelsunderray(vector(targetpos.X, 3, targetpos.Z),
vector(0.0001,-1.0001,0.0001), #detailed)
   whichmodel = void
   totalmodels = modelsListW.count
   repeat with x = 1 to totalmodels
     if modelsListW[x].model = boundaryWall then
       put modelsListW[x].model.name && "hit"
     else
       put "up"
       pCharacter.translate(0,-TheSpeed,0)
     end if
   end repeat
 end if

 modelsListN =  void
 modelsListS =  void
 modelsListE =  void
 modelsListW =  void

end

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
Dir3d-l mailing list
Dir3d-l@(protected)
http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l