Created
June 6, 2016 18:30
-
-
Save eddietree/9e9f72fa8ba55b69199a9ed8c86410e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override Vector3 GetThrowVelocity() | |
{ | |
var device = GetDevice(); | |
// basically to calc throw velocity: | |
// 1) set phantom volume to controller pos | |
// 2) set its velocity calc the velocity point of throwing | |
var rb = throwVolume; | |
rb.transform.position = transform.position; | |
rb.velocity = device.velocity; | |
var throwVelocity = rb.GetPointVelocity(obj.transform.position) * throwVelocityBoost; | |
rb.velocity = Vector3.zero; | |
return throwVelocity; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment