fLUnKnhaXYU Posted March 31 Share Posted March 31 it is safe to assume that pushforce has not yet been deprecated ? its so fun I dont REALLY care . but just drew my curiosity . I cant help but wonder how the networking is . Im sure someone should have a good reliable report on it . ty and have a nicey . Quote Link to comment Share on other sites More sharing options...
Azaezel Posted April 4 Share Posted April 4 pushforce? do you mean applyimpulse or...? Quote Link to comment Share on other sites More sharing options...
fLUnKnhaXYU Posted April 4 Author Share Posted April 4 Azaezel , please excuse me and my jibberish . I recently discovered the physic shape and rigid shape class stuffs . being very impressed I began searching for something to apply force in the same manner for the player character object or avatar or what have you . I couldn't find anything that worked then recalled the player server code from 1.2 that would , as you correctly discerned despite my jibberish , applyImpule and simply effortlessly push whatever class of object right away with not the slightest stuttering of the programmic action , if you will . I added it to the player oncollision callback in 4.01 and it works so well . I just wondered if this or some other method is currently being resorted to . BTW I use the 4.01 binary . this is the part of the oncollision function copied from 1.2 I think its original GG and was presented in the book by Kenneth C Finney 4D Game Programming All-In-One . This works beautifully IMO and there is no problem here but , if there's a more modern approach I'd dig hearing about it . clear as mud? TY. if ((%col.getClassName() !$= "wheeledVehicle") || (%col.getClassName() !$= "item")) { if (vectorLen(%col.getvelocity) <= 2.0) { %pushForce = %obj.getDataBlock().pushForce; // Try to push the object away if (!%pushForce){ %pushForce = %obj.getdatablock().pushforce; } %eye = %obj.getEyeVector(); // Start with the shape's eye vector... %vec = vectorScale(%eye, %pushForce); %vec = vectorAdd(%vec,%obj.getVelocity()); // Add the shape's velocity %pos = %col.getPosition(); // then push %vec = getWords(%vec, 0, 1) @ " 0.0"; %col.applyImpulse(%pos,%vec); } } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.