{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct PhysicsVelocity | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct PhysicsVelocity

    The velocity of a rigid body. If absent, the rigid body is static.

    Implements
    IComponentData
    IQueryTypeParameter
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Physics
    Assembly: solution.dll
    Syntax
    public struct PhysicsVelocity : IComponentData, IQueryTypeParameter

    Fields

    Name Description
    Angular

    The body's angular velocity in radians per second about each principal axis specified by Transform . In order to get or set world-space values, use GetAngularVelocityWorldSpace(in PhysicsVelocity, in PhysicsMass, in quaternion) and SetAngularVelocityWorldSpace(ref PhysicsVelocity, in PhysicsMass, in quaternion, in float3), respectively.

    Linear

    The body's world-space linear velocity in units per second.

    Zero

    Zero Physics Velocity. All fields are initialized to zero.

    Methods

    Name Description
    CalculateVelocityToTarget(in PhysicsMass, in float3, in quaternion, in RigidTransform, in float)

    Create a PhysicsVelocity required to move a body to a target position and orientation. Use this method to control kinematic bodies directly if they need to generate contact events when moving to their new positions. If you need to teleport kinematic bodies you can simply set their LocalTransform component values directly.

    Extension Methods

    PhysicsComponentExtensions.ApplyAngularImpulse(ref PhysicsVelocity, in PhysicsMass, float, in float3)
    PhysicsComponentExtensions.ApplyAngularImpulse(ref PhysicsVelocity, in PhysicsMass, in float3)
    PhysicsComponentExtensions.ApplyExplosionForce(ref PhysicsVelocity, in PhysicsMass, in PhysicsCollider, in float3, in quaternion, float, in float3, in float, in float, in float3, in float, ForceMode)
    PhysicsComponentExtensions.ApplyExplosionForce(ref PhysicsVelocity, in PhysicsMass, in PhysicsCollider, in float3, in quaternion, in float, float, in float3, in float, in float, in float3, in CollisionFilter, in float, ForceMode)
    PhysicsComponentExtensions.ApplyImpulse(ref PhysicsVelocity, in PhysicsMass, in float3, in quaternion, float, in float3, in float3)
    PhysicsComponentExtensions.ApplyImpulse(ref PhysicsVelocity, in PhysicsMass, in float3, in quaternion, in float3, in float3)
    PhysicsComponentExtensions.ApplyLinearImpulse(ref PhysicsVelocity, in PhysicsMass, float, in float3)
    PhysicsComponentExtensions.ApplyLinearImpulse(ref PhysicsVelocity, in PhysicsMass, in float3)
    PhysicsComponentExtensions.GetAngularVelocityWorldSpace(in PhysicsVelocity, in PhysicsMass, in quaternion)
    PhysicsComponentExtensions.GetLinearVelocity(in PhysicsVelocity, PhysicsMass, float3, quaternion, float3)
    PhysicsComponentExtensions.Integrate(in PhysicsVelocity, in PhysicsMass, float, ref float3, ref quaternion)
    PhysicsComponentExtensions.SetAngularVelocityWorldSpace(ref PhysicsVelocity, in PhysicsMass, in quaternion, in float3)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)