add usd-21-11-win64_py39

This commit is contained in:
Sébastien Albert committed 2021-12-07 17:43:55 +01:00
1 parent 41d23e71ba
commit ba5e1f7e67
15684 files changed
+3069957

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
//
// Copyright 2017 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_API_H
#define USDPHYSICS_API_H
#include "pxr/base/arch/export.h"
#if defined(PXR_STATIC)
# define USDPHYSICS_API
# define USDPHYSICS_API_TEMPLATE_CLASS(...)
# define USDPHYSICS_API_TEMPLATE_STRUCT(...)
# define USDPHYSICS_LOCAL
#else
# if defined(USDPHYSICS_EXPORTS)
# define USDPHYSICS_API ARCH_EXPORT
# define USDPHYSICS_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
# define USDPHYSICS_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
# else
# define USDPHYSICS_API ARCH_IMPORT
# define USDPHYSICS_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
# define USDPHYSICS_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
# endif
# define USDPHYSICS_LOCAL ARCH_HIDDEN
#endif
#endif
@@ -0,0 +1,185 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_ARTICULATIONROOTAPI_H
#define USDPHYSICS_GENERATED_ARTICULATIONROOTAPI_H
/// \file usdPhysics/articulationRootAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSARTICULATIONROOTAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsArticulationRootAPI
///
/// PhysicsArticulationRootAPI can be applied to a scene graph node,
/// and marks the subtree rooted here for inclusion in one or more reduced
/// coordinate articulations. For floating articulations, this should be on
/// the root body. For fixed articulations (robotics jargon for e.g. a robot
/// arm for welding that is bolted to the floor), this API can be on a direct
/// or indirect parent of the root joint which is connected to the world, or
/// on the joint itself..
///
class UsdPhysicsArticulationRootAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdPhysicsArticulationRootAPI on UsdPrim \p prim .
/// Equivalent to UsdPhysicsArticulationRootAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsArticulationRootAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdPhysicsArticulationRootAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsArticulationRootAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsArticulationRootAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsArticulationRootAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsArticulationRootAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsArticulationRootAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsArticulationRootAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "PhysicsArticulationRootAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdPhysicsArticulationRootAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsArticulationRootAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsArticulationRootAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+223
View File
@@ -0,0 +1,223 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_COLLISIONAPI_H
#define USDPHYSICS_GENERATED_COLLISIONAPI_H
/// \file usdPhysics/collisionAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSCOLLISIONAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsCollisionAPI
///
/// Applies collision attributes to a UsdGeomXformable prim. If a
/// simulation is running, this geometry will collide with other geometries that
/// have PhysicsCollisionAPI applied. If a prim in the parent hierarchy has the
/// RigidBodyAPI applied, this collider is a part of that body. If there is
/// no body in the parent hierarchy, this collider is considered to be static.
///
class UsdPhysicsCollisionAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdPhysicsCollisionAPI on UsdPrim \p prim .
/// Equivalent to UsdPhysicsCollisionAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsCollisionAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdPhysicsCollisionAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsCollisionAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsCollisionAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsCollisionAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsCollisionAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsCollisionAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsCollisionAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "PhysicsCollisionAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdPhysicsCollisionAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsCollisionAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsCollisionAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// COLLISIONENABLED
// --------------------------------------------------------------------- //
/// Determines if the PhysicsCollisionAPI is enabled.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool physics:collisionEnabled = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
USDPHYSICS_API
UsdAttribute GetCollisionEnabledAttr() const;
/// See GetCollisionEnabledAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateCollisionEnabledAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SIMULATIONOWNER
// --------------------------------------------------------------------- //
/// Single PhysicsScene that will simulate this collider.
/// By default this object belongs to the first PhysicsScene.
/// Note that if a RigidBodyAPI in the hierarchy above has a different
/// simulationOwner then it has a precedence over this relationship.
///
USDPHYSICS_API
UsdRelationship GetSimulationOwnerRel() const;
/// See GetSimulationOwnerRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDPHYSICS_API
UsdRelationship CreateSimulationOwnerRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+195
View File
@@ -0,0 +1,195 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_COLLISIONGROUP_H
#define USDPHYSICS_GENERATED_COLLISIONGROUP_H
/// \file usdPhysics/collisionGroup.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/usd/usd/collectionAPI.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSCOLLISIONGROUP //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsCollisionGroup
///
/// Defines a collision group for coarse filtering. When a collision
/// occurs between two objects that have a PhysicsCollisionGroup assigned,
/// they will collide with each other unless this PhysicsCollisionGroup pair
/// is filtered. See filteredGroups attribute.
///
/// A CollectionAPI:colliders maintains a list of PhysicsCollisionAPI rel-s that
/// defines the members of this Collisiongroup.
///
///
class UsdPhysicsCollisionGroup : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsCollisionGroup on UsdPrim \p prim .
/// Equivalent to UsdPhysicsCollisionGroup::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsCollisionGroup(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a UsdPhysicsCollisionGroup on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsCollisionGroup(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsCollisionGroup(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsCollisionGroup();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsCollisionGroup holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsCollisionGroup(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsCollisionGroup
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsCollisionGroup
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// FILTEREDGROUPS
// --------------------------------------------------------------------- //
/// References a list of PhysicsCollisionGroups with which
/// collisions should be ignored.
///
USDPHYSICS_API
UsdRelationship GetFilteredGroupsRel() const;
/// See GetFilteredGroupsRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDPHYSICS_API
UsdRelationship CreateFilteredGroupsRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
/// Return the UsdCollectionAPI interface used for defining
/// what colliders belong to the CollisionGroup.
USDPHYSICS_API
UsdCollectionAPI GetCollidersCollectionAPI() const;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+213
View File
@@ -0,0 +1,213 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_DISTANCEJOINT_H
#define USDPHYSICS_GENERATED_DISTANCEJOINT_H
/// \file usdPhysics/distanceJoint.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usdPhysics/joint.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSDISTANCEJOINT //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsDistanceJoint
///
/// Predefined distance joint type (Distance between rigid bodies
/// may be limited to given minimum or maximum distance.)
///
class UsdPhysicsDistanceJoint : public UsdPhysicsJoint
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsDistanceJoint on UsdPrim \p prim .
/// Equivalent to UsdPhysicsDistanceJoint::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsDistanceJoint(const UsdPrim& prim=UsdPrim())
: UsdPhysicsJoint(prim)
{
}
/// Construct a UsdPhysicsDistanceJoint on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsDistanceJoint(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsDistanceJoint(const UsdSchemaBase& schemaObj)
: UsdPhysicsJoint(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsDistanceJoint();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsDistanceJoint holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsDistanceJoint(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsDistanceJoint
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsDistanceJoint
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// MINDISTANCE
// --------------------------------------------------------------------- //
/// Minimum distance. If attribute is negative, the joint is not
/// limited. Units: distance.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:minDistance = -1` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetMinDistanceAttr() const;
/// See GetMinDistanceAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateMinDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXDISTANCE
// --------------------------------------------------------------------- //
/// Maximum distance. If attribute is negative, the joint is not
/// limited. Units: distance.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:maxDistance = -1` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetMaxDistanceAttr() const;
/// See GetMaxDistanceAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateMaxDistanceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+382
View File
@@ -0,0 +1,382 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_DRIVEAPI_H
#define USDPHYSICS_GENERATED_DRIVEAPI_H
/// \file usdPhysics/driveAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSDRIVEAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsDriveAPI
///
/// The PhysicsDriveAPI when applied to any joint primitive will drive
/// the joint towards a given target. The PhysicsDriveAPI is a multipleApply
/// schema: drive can be set per axis "transX", "transY", "transZ", "rotX",
/// "rotY", "rotZ" or its "linear" for prismatic joint or "angular" for revolute
/// joints. Setting these as a multipleApply schema TfToken name will
/// define the degree of freedom the DriveAPI is applied to. Each drive is an
/// implicit force-limited damped spring:
/// Force or acceleration = stiffness * (targetPosition - position)
/// + damping * (targetVelocity - velocity)
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref UsdPhysicsTokens.
/// So to set an attribute to the value "rightHanded", use UsdPhysicsTokens->rightHanded
/// as the value.
///
class UsdPhysicsDriveAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::MultipleApplyAPI;
/// Construct a UsdPhysicsDriveAPI on UsdPrim \p prim with
/// name \p name . Equivalent to
/// UsdPhysicsDriveAPI::Get(
/// prim.GetStage(),
/// prim.GetPath().AppendProperty(
/// "drive:name"));
///
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsDriveAPI(
const UsdPrim& prim=UsdPrim(), const TfToken &name=TfToken())
: UsdAPISchemaBase(prim, /*instanceName*/ name)
{ }
/// Construct a UsdPhysicsDriveAPI on the prim held by \p schemaObj with
/// name \p name. Should be preferred over
/// UsdPhysicsDriveAPI(schemaObj.GetPrim(), name), as it preserves
/// SchemaBase state.
explicit UsdPhysicsDriveAPI(
const UsdSchemaBase& schemaObj, const TfToken &name)
: UsdAPISchemaBase(schemaObj, /*instanceName*/ name)
{ }
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsDriveAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes for a given instance name. Does not
/// include attributes that may be authored by custom/extended methods of
/// the schemas involved. The names returned will have the proper namespace
/// prefix.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(
bool includeInherited=true, const TfToken instanceName=TfToken());
/// Returns the name of this multiple-apply schema instance
TfToken GetName() const {
return _GetInstanceName();
}
/// Return a UsdPhysicsDriveAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. \p path must be of the format
/// <path>.drive:name .
///
/// This is shorthand for the following:
///
/// \code
/// TfToken name = SdfPath::StripNamespace(path.GetToken());
/// UsdPhysicsDriveAPI(
/// stage->GetPrimAtPath(path.GetPrimPath()), name);
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsDriveAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Return a UsdPhysicsDriveAPI with name \p name holding the
/// prim \p prim. Shorthand for UsdPhysicsDriveAPI(prim, name);
USDPHYSICS_API
static UsdPhysicsDriveAPI
Get(const UsdPrim &prim, const TfToken &name);
/// Checks if the given name \p baseName is the base name of a property
/// of PhysicsDriveAPI.
USDPHYSICS_API
static bool
IsSchemaPropertyBaseName(const TfToken &baseName);
/// Checks if the given path \p path is of an API schema of type
/// PhysicsDriveAPI. If so, it stores the instance name of
/// the schema in \p name and returns true. Otherwise, it returns false.
USDPHYSICS_API
static bool
IsPhysicsDriveAPIPath(const SdfPath &path, TfToken *name);
/// Returns true if this <b>multiple-apply</b> API schema can be applied,
/// with the given instance name, \p name, to the given \p prim. If this
/// schema can not be a applied the prim, this returns false and, if
/// provided, populates \p whyNot with the reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, const TfToken &name,
std::string *whyNot=nullptr);
/// Applies this <b>multiple-apply</b> API schema to the given \p prim
/// along with the given instance name, \p name.
///
/// This information is stored by adding "PhysicsDriveAPI:<i>name</i>"
/// to the token-valued, listOp metadata \em apiSchemas on the prim.
/// For example, if \p name is 'instance1', the token
/// 'PhysicsDriveAPI:instance1' is added to 'apiSchemas'.
///
/// \return A valid UsdPhysicsDriveAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsDriveAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for
/// conditions resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsDriveAPI
Apply(const UsdPrim &prim, const TfToken &name);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// TYPE
// --------------------------------------------------------------------- //
/// Drive spring is for the acceleration at the joint (rather
/// than the force).
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token physics:type = "force"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdPhysicsTokens "Allowed Values" | force, acceleration |
USDPHYSICS_API
UsdAttribute GetTypeAttr() const;
/// See GetTypeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXFORCE
// --------------------------------------------------------------------- //
/// Maximum force that can be applied to drive. Units:
/// if linear drive: mass*DIST_UNITS/second/second
/// if angular drive: mass*DIST_UNITS*DIST_UNITS/second/second
/// inf means not limited. Must be non-negative.
///
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:maxForce = inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetMaxForceAttr() const;
/// See GetMaxForceAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateMaxForceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// TARGETPOSITION
// --------------------------------------------------------------------- //
/// Target value for position. Units:
/// if linear drive: distance
/// if angular drive: degrees.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:targetPosition = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetTargetPositionAttr() const;
/// See GetTargetPositionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateTargetPositionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// TARGETVELOCITY
// --------------------------------------------------------------------- //
/// Target value for velocity. Units:
/// if linear drive: distance/second
/// if angular drive: degrees/second.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:targetVelocity = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetTargetVelocityAttr() const;
/// See GetTargetVelocityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateTargetVelocityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DAMPING
// --------------------------------------------------------------------- //
/// Damping of the drive. Units:
/// if linear drive: mass/second
/// If angular drive: mass*DIST_UNITS*DIST_UNITS/second/second/degrees.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:damping = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetDampingAttr() const;
/// See GetDampingAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateDampingAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// STIFFNESS
// --------------------------------------------------------------------- //
/// Stiffness of the drive. Units:
/// if linear drive: mass/second/second
/// if angular drive: mass*DIST_UNITS*DIST_UNITS/degree/second/second.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:stiffness = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetStiffnessAttr() const;
/// See GetStiffnessAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateStiffnessAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
@@ -0,0 +1,199 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_FILTEREDPAIRSAPI_H
#define USDPHYSICS_GENERATED_FILTEREDPAIRSAPI_H
/// \file usdPhysics/filteredPairsAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSFILTEREDPAIRSAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsFilteredPairsAPI
///
/// API to describe fine-grained filtering. If a collision between
/// two objects occurs, this pair might be filtered if the pair is defined
/// through this API. This API can be applied either to a body or collision
/// or even articulation. The "filteredPairs" defines what objects it should
/// not collide against. Note that FilteredPairsAPI filtering has precedence
/// over CollisionGroup filtering.
///
class UsdPhysicsFilteredPairsAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdPhysicsFilteredPairsAPI on UsdPrim \p prim .
/// Equivalent to UsdPhysicsFilteredPairsAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsFilteredPairsAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdPhysicsFilteredPairsAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsFilteredPairsAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsFilteredPairsAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsFilteredPairsAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsFilteredPairsAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsFilteredPairsAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsFilteredPairsAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "PhysicsFilteredPairsAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdPhysicsFilteredPairsAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsFilteredPairsAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsFilteredPairsAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// FILTEREDPAIRS
// --------------------------------------------------------------------- //
/// Relationship to objects that should be filtered.
///
USDPHYSICS_API
UsdRelationship GetFilteredPairsRel() const;
/// See GetFilteredPairsRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDPHYSICS_API
UsdRelationship CreateFilteredPairsRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+166
View File
@@ -0,0 +1,166 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_FIXEDJOINT_H
#define USDPHYSICS_GENERATED_FIXEDJOINT_H
/// \file usdPhysics/fixedJoint.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usdPhysics/joint.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSFIXEDJOINT //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsFixedJoint
///
/// Predefined fixed joint type (All degrees of freedom are
/// removed.)
///
class UsdPhysicsFixedJoint : public UsdPhysicsJoint
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsFixedJoint on UsdPrim \p prim .
/// Equivalent to UsdPhysicsFixedJoint::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsFixedJoint(const UsdPrim& prim=UsdPrim())
: UsdPhysicsJoint(prim)
{
}
/// Construct a UsdPhysicsFixedJoint on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsFixedJoint(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsFixedJoint(const UsdSchemaBase& schemaObj)
: UsdPhysicsJoint(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsFixedJoint();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsFixedJoint holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsFixedJoint(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsFixedJoint
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsFixedJoint
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+402
View File
@@ -0,0 +1,402 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_JOINT_H
#define USDPHYSICS_GENERATED_JOINT_H
/// \file usdPhysics/joint.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usdGeom/imageable.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSJOINT //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsJoint
///
/// A joint constrains the movement of rigid bodies. Joint can be
/// created between two rigid bodies or between one rigid body and world.
/// By default joint primitive defines a D6 joint where all degrees of
/// freedom are free. Three linear and three angular degrees of freedom.
/// Note that default behavior is to disable collision between jointed bodies.
///
///
class UsdPhysicsJoint : public UsdGeomImageable
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsJoint on UsdPrim \p prim .
/// Equivalent to UsdPhysicsJoint::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsJoint(const UsdPrim& prim=UsdPrim())
: UsdGeomImageable(prim)
{
}
/// Construct a UsdPhysicsJoint on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsJoint(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsJoint(const UsdSchemaBase& schemaObj)
: UsdGeomImageable(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsJoint();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsJoint holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsJoint(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsJoint
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsJoint
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// LOCALPOS0
// --------------------------------------------------------------------- //
/// Relative position of the joint frame to body0's frame.
///
/// | ||
/// | -- | -- |
/// | Declaration | `point3f physics:localPos0 = (0, 0, 0)` |
/// | C++ Type | GfVec3f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Point3f |
USDPHYSICS_API
UsdAttribute GetLocalPos0Attr() const;
/// See GetLocalPos0Attr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateLocalPos0Attr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// LOCALROT0
// --------------------------------------------------------------------- //
/// Relative orientation of the joint frame to body0's frame.
///
/// | ||
/// | -- | -- |
/// | Declaration | `quatf physics:localRot0 = (1, 0, 0, 0)` |
/// | C++ Type | GfQuatf |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Quatf |
USDPHYSICS_API
UsdAttribute GetLocalRot0Attr() const;
/// See GetLocalRot0Attr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateLocalRot0Attr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// LOCALPOS1
// --------------------------------------------------------------------- //
/// Relative position of the joint frame to body1's frame.
///
/// | ||
/// | -- | -- |
/// | Declaration | `point3f physics:localPos1 = (0, 0, 0)` |
/// | C++ Type | GfVec3f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Point3f |
USDPHYSICS_API
UsdAttribute GetLocalPos1Attr() const;
/// See GetLocalPos1Attr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateLocalPos1Attr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// LOCALROT1
// --------------------------------------------------------------------- //
/// Relative orientation of the joint frame to body1's frame.
///
/// | ||
/// | -- | -- |
/// | Declaration | `quatf physics:localRot1 = (1, 0, 0, 0)` |
/// | C++ Type | GfQuatf |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Quatf |
USDPHYSICS_API
UsdAttribute GetLocalRot1Attr() const;
/// See GetLocalRot1Attr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateLocalRot1Attr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// JOINTENABLED
// --------------------------------------------------------------------- //
/// Determines if the joint is enabled.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool physics:jointEnabled = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
USDPHYSICS_API
UsdAttribute GetJointEnabledAttr() const;
/// See GetJointEnabledAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateJointEnabledAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// COLLISIONENABLED
// --------------------------------------------------------------------- //
/// Determines if the jointed subtrees should collide or not.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool physics:collisionEnabled = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
USDPHYSICS_API
UsdAttribute GetCollisionEnabledAttr() const;
/// See GetCollisionEnabledAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateCollisionEnabledAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// EXCLUDEFROMARTICULATION
// --------------------------------------------------------------------- //
/// Determines if the joint can be included in an Articulation.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform bool physics:excludeFromArticulation = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDPHYSICS_API
UsdAttribute GetExcludeFromArticulationAttr() const;
/// See GetExcludeFromArticulationAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateExcludeFromArticulationAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// BREAKFORCE
// --------------------------------------------------------------------- //
/// Joint break force. If set, joint is to break when this force
/// limit is reached. (Used for linear DOFs.)
/// Units: mass * distance / second / second
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:breakForce = inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetBreakForceAttr() const;
/// See GetBreakForceAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateBreakForceAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// BREAKTORQUE
// --------------------------------------------------------------------- //
/// Joint break torque. If set, joint is to break when this torque
/// limit is reached. (Used for angular DOFs.)
/// Units: mass * distance * distance / second / second
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:breakTorque = inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetBreakTorqueAttr() const;
/// See GetBreakTorqueAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateBreakTorqueAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// BODY0
// --------------------------------------------------------------------- //
/// Relationship to any UsdGeomXformable.
///
USDPHYSICS_API
UsdRelationship GetBody0Rel() const;
/// See GetBody0Rel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDPHYSICS_API
UsdRelationship CreateBody0Rel() const;
public:
// --------------------------------------------------------------------- //
// BODY1
// --------------------------------------------------------------------- //
/// Relationship to any UsdGeomXformable.
///
USDPHYSICS_API
UsdRelationship GetBody1Rel() const;
/// See GetBody1Rel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDPHYSICS_API
UsdRelationship CreateBody1Rel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+274
View File
@@ -0,0 +1,274 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_LIMITAPI_H
#define USDPHYSICS_GENERATED_LIMITAPI_H
/// \file usdPhysics/limitAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSLIMITAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsLimitAPI
///
/// The PhysicsLimitAPI can be applied to a PhysicsJoint and will
/// restrict the movement along an axis. PhysicsLimitAPI is a multipleApply
/// schema: The PhysicsJoint can be restricted along "transX", "transY",
/// "transZ", "rotX", "rotY", "rotZ", "distance". Setting these as a
/// multipleApply schema TfToken name will define the degree of freedom the
/// PhysicsLimitAPI is applied to. Note that if the low limit is higher than
/// the high limit, motion along this axis is considered locked.
///
class UsdPhysicsLimitAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::MultipleApplyAPI;
/// Construct a UsdPhysicsLimitAPI on UsdPrim \p prim with
/// name \p name . Equivalent to
/// UsdPhysicsLimitAPI::Get(
/// prim.GetStage(),
/// prim.GetPath().AppendProperty(
/// "limit:name"));
///
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsLimitAPI(
const UsdPrim& prim=UsdPrim(), const TfToken &name=TfToken())
: UsdAPISchemaBase(prim, /*instanceName*/ name)
{ }
/// Construct a UsdPhysicsLimitAPI on the prim held by \p schemaObj with
/// name \p name. Should be preferred over
/// UsdPhysicsLimitAPI(schemaObj.GetPrim(), name), as it preserves
/// SchemaBase state.
explicit UsdPhysicsLimitAPI(
const UsdSchemaBase& schemaObj, const TfToken &name)
: UsdAPISchemaBase(schemaObj, /*instanceName*/ name)
{ }
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsLimitAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes for a given instance name. Does not
/// include attributes that may be authored by custom/extended methods of
/// the schemas involved. The names returned will have the proper namespace
/// prefix.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(
bool includeInherited=true, const TfToken instanceName=TfToken());
/// Returns the name of this multiple-apply schema instance
TfToken GetName() const {
return _GetInstanceName();
}
/// Return a UsdPhysicsLimitAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. \p path must be of the format
/// <path>.limit:name .
///
/// This is shorthand for the following:
///
/// \code
/// TfToken name = SdfPath::StripNamespace(path.GetToken());
/// UsdPhysicsLimitAPI(
/// stage->GetPrimAtPath(path.GetPrimPath()), name);
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsLimitAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Return a UsdPhysicsLimitAPI with name \p name holding the
/// prim \p prim. Shorthand for UsdPhysicsLimitAPI(prim, name);
USDPHYSICS_API
static UsdPhysicsLimitAPI
Get(const UsdPrim &prim, const TfToken &name);
/// Checks if the given name \p baseName is the base name of a property
/// of PhysicsLimitAPI.
USDPHYSICS_API
static bool
IsSchemaPropertyBaseName(const TfToken &baseName);
/// Checks if the given path \p path is of an API schema of type
/// PhysicsLimitAPI. If so, it stores the instance name of
/// the schema in \p name and returns true. Otherwise, it returns false.
USDPHYSICS_API
static bool
IsPhysicsLimitAPIPath(const SdfPath &path, TfToken *name);
/// Returns true if this <b>multiple-apply</b> API schema can be applied,
/// with the given instance name, \p name, to the given \p prim. If this
/// schema can not be a applied the prim, this returns false and, if
/// provided, populates \p whyNot with the reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, const TfToken &name,
std::string *whyNot=nullptr);
/// Applies this <b>multiple-apply</b> API schema to the given \p prim
/// along with the given instance name, \p name.
///
/// This information is stored by adding "PhysicsLimitAPI:<i>name</i>"
/// to the token-valued, listOp metadata \em apiSchemas on the prim.
/// For example, if \p name is 'instance1', the token
/// 'PhysicsLimitAPI:instance1' is added to 'apiSchemas'.
///
/// \return A valid UsdPhysicsLimitAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsLimitAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for
/// conditions resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsLimitAPI
Apply(const UsdPrim &prim, const TfToken &name);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// LOW
// --------------------------------------------------------------------- //
/// Lower limit. Units: degrees or distance depending on trans or
/// rot axis applied to. -inf means not limited in negative direction.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:low = -inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetLowAttr() const;
/// See GetLowAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateLowAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// HIGH
// --------------------------------------------------------------------- //
/// Upper limit. Units: degrees or distance depending on trans or
/// rot axis applied to. inf means not limited in positive direction.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:high = inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetHighAttr() const;
/// See GetHighAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateHighAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+314
View File
@@ -0,0 +1,314 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_MASSAPI_H
#define USDPHYSICS_GENERATED_MASSAPI_H
/// \file usdPhysics/massAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSMASSAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsMassAPI
///
/// Defines explicit mass properties (mass, density, inertia etc.).
/// MassAPI can be applied to any object that has a PhysicsCollisionAPI or
/// a PhysicsRigidBodyAPI.
///
class UsdPhysicsMassAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdPhysicsMassAPI on UsdPrim \p prim .
/// Equivalent to UsdPhysicsMassAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsMassAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdPhysicsMassAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsMassAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsMassAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsMassAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsMassAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsMassAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsMassAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "PhysicsMassAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdPhysicsMassAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsMassAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsMassAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// MASS
// --------------------------------------------------------------------- //
/// If non-zero, directly specifies the mass of the object.
/// Note that any child prim can also have a mass when they apply massAPI.
/// In this case, the precedence rule is 'parent mass overrides the
/// child's'. This may come as counter-intuitive, but mass is a computed
/// quantity and in general not accumulative. For example, if a parent
/// has mass of 10, and one of two children has mass of 20, allowing
/// child's mass to override its parent results in a mass of -10 for the
/// other child. Note if mass is 0.0 it is ignored. Units: mass.
///
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:mass = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetMassAttr() const;
/// See GetMassAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateMassAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DENSITY
// --------------------------------------------------------------------- //
/// If non-zero, specifies the density of the object.
/// In the context of rigid body physics, density indirectly results in
/// setting mass via (mass = density x volume of the object). How the
/// volume is computed is up to implementation of the physics system.
/// It is generally computed from the collision approximation rather than
/// the graphical mesh. In the case where both density and mass are
/// specified for the same object, mass has precedence over density.
/// Unlike mass, child's prim's density overrides parent prim's density
/// as it is accumulative. Note that density of a collisionAPI can be also
/// alternatively set through a PhysicsMaterialAPI. The material density
/// has the weakest precedence in density definition. Note if density is
/// 0.0 it is ignored. Units: mass/distance/distance/distance.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:density = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetDensityAttr() const;
/// See GetDensityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// CENTEROFMASS
// --------------------------------------------------------------------- //
/// Center of mass in the prim's local space. Units: distance.
///
/// | ||
/// | -- | -- |
/// | Declaration | `point3f physics:centerOfMass = (0, 0, 0)` |
/// | C++ Type | GfVec3f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Point3f |
USDPHYSICS_API
UsdAttribute GetCenterOfMassAttr() const;
/// See GetCenterOfMassAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateCenterOfMassAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DIAGONALINERTIA
// --------------------------------------------------------------------- //
/// If non-zero, specifies diagonalized inertia tensor along the
/// principal axes. Note if diagonalInertial is (0.0, 0.0, 0.0) it is
/// ignored. Units: mass*distance*distance.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float3 physics:diagonalInertia = (0, 0, 0)` |
/// | C++ Type | GfVec3f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float3 |
USDPHYSICS_API
UsdAttribute GetDiagonalInertiaAttr() const;
/// See GetDiagonalInertiaAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateDiagonalInertiaAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PRINCIPALAXES
// --------------------------------------------------------------------- //
/// Orientation of the inertia tensor's principal axes in the
/// prim's local space.
///
/// | ||
/// | -- | -- |
/// | Declaration | `quatf physics:principalAxes = (1, 0, 0, 0)` |
/// | C++ Type | GfQuatf |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Quatf |
USDPHYSICS_API
UsdAttribute GetPrincipalAxesAttr() const;
/// See GetPrincipalAxesAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreatePrincipalAxesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+273
View File
@@ -0,0 +1,273 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_MATERIALAPI_H
#define USDPHYSICS_GENERATED_MATERIALAPI_H
/// \file usdPhysics/materialAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSMATERIALAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsMaterialAPI
///
/// Adds simulation material properties to a Material. All collisions
/// that have a relationship to this material will have their collision response
/// defined through this material.
///
class UsdPhysicsMaterialAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdPhysicsMaterialAPI on UsdPrim \p prim .
/// Equivalent to UsdPhysicsMaterialAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsMaterialAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdPhysicsMaterialAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsMaterialAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsMaterialAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsMaterialAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsMaterialAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsMaterialAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsMaterialAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "PhysicsMaterialAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdPhysicsMaterialAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsMaterialAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsMaterialAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// DYNAMICFRICTION
// --------------------------------------------------------------------- //
/// Dynamic friction coefficient. Unitless.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:dynamicFriction = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetDynamicFrictionAttr() const;
/// See GetDynamicFrictionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateDynamicFrictionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// STATICFRICTION
// --------------------------------------------------------------------- //
/// Static friction coefficient. Unitless.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:staticFriction = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetStaticFrictionAttr() const;
/// See GetStaticFrictionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateStaticFrictionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// RESTITUTION
// --------------------------------------------------------------------- //
/// Restitution coefficient. Unitless.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:restitution = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetRestitutionAttr() const;
/// See GetRestitutionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateRestitutionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DENSITY
// --------------------------------------------------------------------- //
/// If non-zero, defines the density of the material. This can be
/// used for body mass computation, see PhysicsMassAPI.
/// Note that if the density is 0.0 it is ignored.
/// Units: mass/distance/distance/distance.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:density = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetDensityAttr() const;
/// See GetDensityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateDensityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
@@ -0,0 +1,223 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_MESHCOLLISIONAPI_H
#define USDPHYSICS_GENERATED_MESHCOLLISIONAPI_H
/// \file usdPhysics/meshCollisionAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSMESHCOLLISIONAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsMeshCollisionAPI
///
/// Attributes to control how a Mesh is made into a collider.
/// Can be applied to only a USDGeomMesh in addition to its
/// PhysicsCollisionAPI.
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref UsdPhysicsTokens.
/// So to set an attribute to the value "rightHanded", use UsdPhysicsTokens->rightHanded
/// as the value.
///
class UsdPhysicsMeshCollisionAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdPhysicsMeshCollisionAPI on UsdPrim \p prim .
/// Equivalent to UsdPhysicsMeshCollisionAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsMeshCollisionAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdPhysicsMeshCollisionAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsMeshCollisionAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsMeshCollisionAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsMeshCollisionAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsMeshCollisionAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsMeshCollisionAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsMeshCollisionAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "PhysicsMeshCollisionAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdPhysicsMeshCollisionAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsMeshCollisionAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsMeshCollisionAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// APPROXIMATION
// --------------------------------------------------------------------- //
/// Determines the mesh's collision approximation:
/// "none" - The mesh geometry is used directly as a collider without any
/// approximation.
/// "convexDecomposition" - A convex mesh decomposition is performed. This
/// results in a set of convex mesh colliders.
/// "convexHull" - A convex hull of the mesh is generated and used as the
/// collider.
/// "boundingSphere" - A bounding sphere is computed around the mesh and used
/// as a collider.
/// "boundingCube" - An optimally fitting box collider is computed around the
/// mesh.
/// "meshSimplification" - A mesh simplification step is performed, resulting
/// in a simplified triangle mesh collider.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token physics:approximation = "none"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdPhysicsTokens "Allowed Values" | none, convexDecomposition, convexHull, boundingSphere, boundingCube, meshSimplification |
USDPHYSICS_API
UsdAttribute GetApproximationAttr() const;
/// See GetApproximationAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateApproximationAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+85
View File
@@ -0,0 +1,85 @@
//
// Copyright 2021 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef PXR_USD_USD_PHYSICS_METRICS_H
#define PXR_USD_USD_PHYSICS_METRICS_H
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/common.h"
PXR_NAMESPACE_OPEN_SCOPE
/// \file usdPhysics/metrics.h
///
/// Helper APIs for physics related metrics operations.
/// Return *stage*'s authored *kilogramsPerUnit*, or 1.0 if unauthored.
USDPHYSICS_API
double UsdPhysicsGetStageKilogramsPerUnit(const UsdStageWeakPtr &stage);
/// Return whether *stage* has an authored *kilogramsPerUnit*.
USDPHYSICS_API
bool UsdPhysicsStageHasAuthoredKilogramsPerUnit(const UsdStageWeakPtr &stage);
/// Author *stage*'s *kilogramsPerUnit*.
///
/// \return true if kilogramsPerUnit was successfully set. The stage's
/// UsdEditTarget must be either its root layer or session layer.
USDPHYSICS_API
bool UsdPhysicsSetStageKilogramsPerUnit(const UsdStageWeakPtr &stage,
double kilogramsPerUnit);
/// Return *true* if the two given metrics are within the provided
/// relative *epsilon* of each other, when you need to know an absolute
/// metric rather than a scaling factor.
///
/// Use like so:
/// \code
/// double stageUnits = UsdPhysicsGetStageKilogramsPerUnit(stage);
///
/// if (UsdPhysicsMassUnitsAre(stageUnits, UsdPhysicsMassUnits::kilograms))
/// // do something for kilograms
/// else if (UsdPhysicsMassUnitsAre(stageUnits, UsdPhysicsMassUnits::grams))
/// // do something for grams
/// \endcode
///
/// \return *false* if either input is zero or negative, otherwise relative
/// floating-point comparison between the two inputs.
USDPHYSICS_API
bool UsdPhysicsMassUnitsAre(double authoredUnits, double standardUnits,
double epsilon = 1e-5);
/// \class UsdPhysicsMassUnits
/// Container class for static double-precision symbols representing common
/// mass units of measure expressed in kilograms.
class UsdPhysicsMassUnits {
public:
static constexpr double grams = 0.001;
static constexpr double kilograms = 1.0;
static constexpr double slugs = 14.5939;
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif // PXR_USD_USD_PHYSICS_METRICS_H
+242
View File
@@ -0,0 +1,242 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_PRISMATICJOINT_H
#define USDPHYSICS_GENERATED_PRISMATICJOINT_H
/// \file usdPhysics/prismaticJoint.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usdPhysics/joint.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSPRISMATICJOINT //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsPrismaticJoint
///
/// Predefined prismatic joint type (translation along prismatic
/// joint axis is permitted.)
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref UsdPhysicsTokens.
/// So to set an attribute to the value "rightHanded", use UsdPhysicsTokens->rightHanded
/// as the value.
///
class UsdPhysicsPrismaticJoint : public UsdPhysicsJoint
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsPrismaticJoint on UsdPrim \p prim .
/// Equivalent to UsdPhysicsPrismaticJoint::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsPrismaticJoint(const UsdPrim& prim=UsdPrim())
: UsdPhysicsJoint(prim)
{
}
/// Construct a UsdPhysicsPrismaticJoint on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsPrismaticJoint(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsPrismaticJoint(const UsdSchemaBase& schemaObj)
: UsdPhysicsJoint(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsPrismaticJoint();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsPrismaticJoint holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsPrismaticJoint(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsPrismaticJoint
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsPrismaticJoint
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// AXIS
// --------------------------------------------------------------------- //
/// Joint axis.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token physics:axis = "X"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdPhysicsTokens "Allowed Values" | X, Y, Z |
USDPHYSICS_API
UsdAttribute GetAxisAttr() const;
/// See GetAxisAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateAxisAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// LOWERLIMIT
// --------------------------------------------------------------------- //
/// Lower limit. Units: distance. -inf means not limited in
/// negative direction.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:lowerLimit = -inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetLowerLimitAttr() const;
/// See GetLowerLimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateLowerLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// UPPERLIMIT
// --------------------------------------------------------------------- //
/// Upper limit. Units: distance. inf means not limited in
/// positive direction.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:upperLimit = inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetUpperLimitAttr() const;
/// See GetUpperLimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateUpperLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+242
View File
@@ -0,0 +1,242 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_REVOLUTEJOINT_H
#define USDPHYSICS_GENERATED_REVOLUTEJOINT_H
/// \file usdPhysics/revoluteJoint.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usdPhysics/joint.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSREVOLUTEJOINT //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsRevoluteJoint
///
/// Predefined revolute joint type (rotation along revolute joint
/// axis is permitted.)
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref UsdPhysicsTokens.
/// So to set an attribute to the value "rightHanded", use UsdPhysicsTokens->rightHanded
/// as the value.
///
class UsdPhysicsRevoluteJoint : public UsdPhysicsJoint
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsRevoluteJoint on UsdPrim \p prim .
/// Equivalent to UsdPhysicsRevoluteJoint::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsRevoluteJoint(const UsdPrim& prim=UsdPrim())
: UsdPhysicsJoint(prim)
{
}
/// Construct a UsdPhysicsRevoluteJoint on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsRevoluteJoint(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsRevoluteJoint(const UsdSchemaBase& schemaObj)
: UsdPhysicsJoint(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsRevoluteJoint();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsRevoluteJoint holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsRevoluteJoint(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsRevoluteJoint
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsRevoluteJoint
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// AXIS
// --------------------------------------------------------------------- //
/// Joint axis.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token physics:axis = "X"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdPhysicsTokens "Allowed Values" | X, Y, Z |
USDPHYSICS_API
UsdAttribute GetAxisAttr() const;
/// See GetAxisAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateAxisAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// LOWERLIMIT
// --------------------------------------------------------------------- //
/// Lower limit. Units: degrees. -inf means not limited in
/// negative direction.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:lowerLimit = -inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetLowerLimitAttr() const;
/// See GetLowerLimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateLowerLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// UPPERLIMIT
// --------------------------------------------------------------------- //
/// Upper limit. Units: degrees. inf means not limited in
/// positive direction.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:upperLimit = inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetUpperLimitAttr() const;
/// See GetUpperLimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateUpperLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+316
View File
@@ -0,0 +1,316 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_RIGIDBODYAPI_H
#define USDPHYSICS_GENERATED_RIGIDBODYAPI_H
/// \file usdPhysics/rigidBodyAPI.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSRIGIDBODYAPI //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsRigidBodyAPI
///
/// Applies physics body attributes to any UsdGeomXformable prim and
/// marks that prim to be driven by a simulation. If a simulation is running
/// it will update this prim's pose. All prims in the hierarchy below this
/// prim should move accordingly.
///
class UsdPhysicsRigidBodyAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a UsdPhysicsRigidBodyAPI on UsdPrim \p prim .
/// Equivalent to UsdPhysicsRigidBodyAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsRigidBodyAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a UsdPhysicsRigidBodyAPI on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsRigidBodyAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsRigidBodyAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsRigidBodyAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsRigidBodyAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsRigidBodyAPI(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsRigidBodyAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "PhysicsRigidBodyAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid UsdPhysicsRigidBodyAPI object is returned upon success.
/// An invalid (or empty) UsdPhysicsRigidBodyAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
USDPHYSICS_API
static UsdPhysicsRigidBodyAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// RIGIDBODYENABLED
// --------------------------------------------------------------------- //
/// Determines if this PhysicsRigidBodyAPI is enabled.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool physics:rigidBodyEnabled = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
USDPHYSICS_API
UsdAttribute GetRigidBodyEnabledAttr() const;
/// See GetRigidBodyEnabledAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateRigidBodyEnabledAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// KINEMATICENABLED
// --------------------------------------------------------------------- //
/// Determines whether the body is kinematic or not. A kinematic
/// body is a body that is moved through animated poses or through
/// user defined poses. The simulation derives velocities for the
/// kinematic body based on the external motion. When a continuous motion
/// is not desired, this kinematic flag should be set to false.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool physics:kinematicEnabled = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
USDPHYSICS_API
UsdAttribute GetKinematicEnabledAttr() const;
/// See GetKinematicEnabledAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateKinematicEnabledAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// STARTSASLEEP
// --------------------------------------------------------------------- //
/// Determines if the body is asleep when the simulation starts.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform bool physics:startsAsleep = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
USDPHYSICS_API
UsdAttribute GetStartsAsleepAttr() const;
/// See GetStartsAsleepAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateStartsAsleepAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// VELOCITY
// --------------------------------------------------------------------- //
/// Linear velocity in the same space as the node's xform.
/// Units: distance/second.
///
/// | ||
/// | -- | -- |
/// | Declaration | `vector3f physics:velocity = (0, 0, 0)` |
/// | C++ Type | GfVec3f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Vector3f |
USDPHYSICS_API
UsdAttribute GetVelocityAttr() const;
/// See GetVelocityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateVelocityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ANGULARVELOCITY
// --------------------------------------------------------------------- //
/// Angular velocity in the same space as the node's xform.
/// Units: degrees/second.
///
/// | ||
/// | -- | -- |
/// | Declaration | `vector3f physics:angularVelocity = (0, 0, 0)` |
/// | C++ Type | GfVec3f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Vector3f |
USDPHYSICS_API
UsdAttribute GetAngularVelocityAttr() const;
/// See GetAngularVelocityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateAngularVelocityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SIMULATIONOWNER
// --------------------------------------------------------------------- //
/// Single PhysicsScene that will simulate this body. By
/// default this is the first PhysicsScene found in the stage using
/// UsdStage::Traverse().
///
USDPHYSICS_API
UsdRelationship GetSimulationOwnerRel() const;
/// See GetSimulationOwnerRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
USDPHYSICS_API
UsdRelationship CreateSimulationOwnerRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+215
View File
@@ -0,0 +1,215 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_SCENE_H
#define USDPHYSICS_GENERATED_SCENE_H
/// \file usdPhysics/scene.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSSCENE //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsScene
///
/// General physics simulation properties, required for simulation.
///
class UsdPhysicsScene : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsScene on UsdPrim \p prim .
/// Equivalent to UsdPhysicsScene::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsScene(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a UsdPhysicsScene on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsScene(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsScene(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsScene();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsScene holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsScene(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsScene
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsScene
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// GRAVITYDIRECTION
// --------------------------------------------------------------------- //
/// Gravity direction vector in simulation world space. Will be
/// normalized before use. A zero vector is a request to use the negative
/// upAxis. Unitless.
///
/// | ||
/// | -- | -- |
/// | Declaration | `vector3f physics:gravityDirection = (0, 0, 0)` |
/// | C++ Type | GfVec3f |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Vector3f |
USDPHYSICS_API
UsdAttribute GetGravityDirectionAttr() const;
/// See GetGravityDirectionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateGravityDirectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// GRAVITYMAGNITUDE
// --------------------------------------------------------------------- //
/// Gravity acceleration magnitude in simulation world space.
/// A negative value is a request to use a value equivalent to earth
/// gravity regardless of the metersPerUnit scaling used by this scene.
/// Units: distance/second/second.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:gravityMagnitude = -inf` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetGravityMagnitudeAttr() const;
/// See GetGravityMagnitudeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateGravityMagnitudeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+246
View File
@@ -0,0 +1,246 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_GENERATED_SPHERICALJOINT_H
#define USDPHYSICS_GENERATED_SPHERICALJOINT_H
/// \file usdPhysics/sphericalJoint.h
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/usd/usdPhysics/joint.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include "pxr/usd/usdPhysics/tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// PHYSICSSPHERICALJOINT //
// -------------------------------------------------------------------------- //
/// \class UsdPhysicsSphericalJoint
///
/// Predefined spherical joint type (Removes linear degrees of
/// freedom, cone limit may restrict the motion in a given range.) It allows
/// two limit values, which when equal create a circular, else an elliptic
/// cone limit around the limit axis.
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref UsdPhysicsTokens.
/// So to set an attribute to the value "rightHanded", use UsdPhysicsTokens->rightHanded
/// as the value.
///
class UsdPhysicsSphericalJoint : public UsdPhysicsJoint
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a UsdPhysicsSphericalJoint on UsdPrim \p prim .
/// Equivalent to UsdPhysicsSphericalJoint::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit UsdPhysicsSphericalJoint(const UsdPrim& prim=UsdPrim())
: UsdPhysicsJoint(prim)
{
}
/// Construct a UsdPhysicsSphericalJoint on the prim held by \p schemaObj .
/// Should be preferred over UsdPhysicsSphericalJoint(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit UsdPhysicsSphericalJoint(const UsdSchemaBase& schemaObj)
: UsdPhysicsJoint(schemaObj)
{
}
/// Destructor.
USDPHYSICS_API
virtual ~UsdPhysicsSphericalJoint();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
USDPHYSICS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a UsdPhysicsSphericalJoint holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// UsdPhysicsSphericalJoint(stage->GetPrimAtPath(path));
/// \endcode
///
USDPHYSICS_API
static UsdPhysicsSphericalJoint
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
USDPHYSICS_API
static UsdPhysicsSphericalJoint
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
USDPHYSICS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
USDPHYSICS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
USDPHYSICS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// AXIS
// --------------------------------------------------------------------- //
/// Cone limit axis.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token physics:axis = "X"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref UsdPhysicsTokens "Allowed Values" | X, Y, Z |
USDPHYSICS_API
UsdAttribute GetAxisAttr() const;
/// See GetAxisAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateAxisAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// CONEANGLE0LIMIT
// --------------------------------------------------------------------- //
/// Cone limit from the primary joint axis in the local0 frame
/// toward the next axis. (Next axis of X is Y, and of Z is X.) A
/// negative value means not limited. Units: degrees.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:coneAngle0Limit = -1` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetConeAngle0LimitAttr() const;
/// See GetConeAngle0LimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateConeAngle0LimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// CONEANGLE1LIMIT
// --------------------------------------------------------------------- //
/// Cone limit from the primary joint axis in the local0 frame
/// toward the second to next axis. A negative value means not limited.
/// Units: degrees.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float physics:coneAngle1Limit = -1` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
USDPHYSICS_API
UsdAttribute GetConeAngle1LimitAttr() const;
/// See GetConeAngle1LimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
USDPHYSICS_API
UsdAttribute CreateConeAngle1LimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
+353
View File
@@ -0,0 +1,353 @@
//
// Copyright 2016 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef USDPHYSICS_TOKENS_H
#define USDPHYSICS_TOKENS_H
/// \file usdPhysics/tokens.h
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//
// This is an automatically generated file (by usdGenSchema.py).
// Do not hand-edit!
//
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include "pxr/pxr.h"
#include "pxr/usd/usdPhysics/api.h"
#include "pxr/base/tf/staticData.h"
#include "pxr/base/tf/token.h"
#include <vector>
PXR_NAMESPACE_OPEN_SCOPE
/// \class UsdPhysicsTokensType
///
/// \link UsdPhysicsTokens \endlink provides static, efficient
/// \link TfToken TfTokens\endlink for use in all public USD API.
///
/// These tokens are auto-generated from the module's schema, representing
/// property names, for when you need to fetch an attribute or relationship
/// directly by name, e.g. UsdPrim::GetAttribute(), in the most efficient
/// manner, and allow the compiler to verify that you spelled the name
/// correctly.
///
/// UsdPhysicsTokens also contains all of the \em allowedTokens values
/// declared for schema builtin attributes of 'token' scene description type.
/// Use UsdPhysicsTokens like so:
///
/// \code
/// gprim.GetMyTokenValuedAttr().Set(UsdPhysicsTokens->acceleration);
/// \endcode
struct UsdPhysicsTokensType {
USDPHYSICS_API UsdPhysicsTokensType();
/// \brief "acceleration"
///
/// Possible value for UsdPhysicsDriveAPI::GetTypeAttr()
const TfToken acceleration;
/// \brief "angular"
///
/// This token represents the angular degree of freedom used in Revolute Joint Drive.
const TfToken angular;
/// \brief "boundingCube"
///
/// Possible value for UsdPhysicsMeshCollisionAPI::GetApproximationAttr()
const TfToken boundingCube;
/// \brief "boundingSphere"
///
/// Possible value for UsdPhysicsMeshCollisionAPI::GetApproximationAttr()
const TfToken boundingSphere;
/// \brief "colliders"
///
/// This token represents the collection name to use with UsdCollectionAPI to represent colliders of a CollisionGroup prim.
const TfToken colliders;
/// \brief "convexDecomposition"
///
/// Possible value for UsdPhysicsMeshCollisionAPI::GetApproximationAttr()
const TfToken convexDecomposition;
/// \brief "convexHull"
///
/// Possible value for UsdPhysicsMeshCollisionAPI::GetApproximationAttr()
const TfToken convexHull;
/// \brief "distance"
///
/// This token represents the distance limit used for generic D6 joint.
const TfToken distance;
/// \brief "drive"
///
/// Property namespace prefix for the UsdPhysicsDriveAPI schema.
const TfToken drive;
/// \brief "force"
///
/// Possible value for UsdPhysicsDriveAPI::GetTypeAttr(), Default value for UsdPhysicsDriveAPI::GetTypeAttr()
const TfToken force;
/// \brief "kilogramsPerUnit"
///
/// Stage-level metadata that encodes a scene's linear unit of measure as kilograms per encoded unit.
const TfToken kilogramsPerUnit;
/// \brief "limit"
///
/// Property namespace prefix for the UsdPhysicsLimitAPI schema.
const TfToken limit;
/// \brief "linear"
///
/// This token represents the linear degree of freedom used in Prismatic Joint Drive.
const TfToken linear;
/// \brief "meshSimplification"
///
/// Possible value for UsdPhysicsMeshCollisionAPI::GetApproximationAttr()
const TfToken meshSimplification;
/// \brief "none"
///
/// Possible value for UsdPhysicsMeshCollisionAPI::GetApproximationAttr(), Default value for UsdPhysicsMeshCollisionAPI::GetApproximationAttr()
const TfToken none;
/// \brief "physics:angularVelocity"
///
/// UsdPhysicsRigidBodyAPI
const TfToken physicsAngularVelocity;
/// \brief "physics:approximation"
///
/// UsdPhysicsMeshCollisionAPI
const TfToken physicsApproximation;
/// \brief "physics:axis"
///
/// UsdPhysicsSphericalJoint, UsdPhysicsPrismaticJoint, UsdPhysicsRevoluteJoint
const TfToken physicsAxis;
/// \brief "physics:body0"
///
/// UsdPhysicsJoint
const TfToken physicsBody0;
/// \brief "physics:body1"
///
/// UsdPhysicsJoint
const TfToken physicsBody1;
/// \brief "physics:breakForce"
///
/// UsdPhysicsJoint
const TfToken physicsBreakForce;
/// \brief "physics:breakTorque"
///
/// UsdPhysicsJoint
const TfToken physicsBreakTorque;
/// \brief "physics:centerOfMass"
///
/// UsdPhysicsMassAPI
const TfToken physicsCenterOfMass;
/// \brief "physics:collisionEnabled"
///
/// UsdPhysicsJoint, UsdPhysicsCollisionAPI
const TfToken physicsCollisionEnabled;
/// \brief "physics:coneAngle0Limit"
///
/// UsdPhysicsSphericalJoint
const TfToken physicsConeAngle0Limit;
/// \brief "physics:coneAngle1Limit"
///
/// UsdPhysicsSphericalJoint
const TfToken physicsConeAngle1Limit;
/// \brief "physics:damping"
///
/// UsdPhysicsDriveAPI
const TfToken physicsDamping;
/// \brief "physics:density"
///
/// UsdPhysicsMaterialAPI, UsdPhysicsMassAPI
const TfToken physicsDensity;
/// \brief "physics:diagonalInertia"
///
/// UsdPhysicsMassAPI
const TfToken physicsDiagonalInertia;
/// \brief "physics:dynamicFriction"
///
/// UsdPhysicsMaterialAPI
const TfToken physicsDynamicFriction;
/// \brief "physics:excludeFromArticulation"
///
/// UsdPhysicsJoint
const TfToken physicsExcludeFromArticulation;
/// \brief "physics:filteredGroups"
///
/// UsdPhysicsCollisionGroup
const TfToken physicsFilteredGroups;
/// \brief "physics:filteredPairs"
///
/// UsdPhysicsFilteredPairsAPI
const TfToken physicsFilteredPairs;
/// \brief "physics:gravityDirection"
///
/// UsdPhysicsScene
const TfToken physicsGravityDirection;
/// \brief "physics:gravityMagnitude"
///
/// UsdPhysicsScene
const TfToken physicsGravityMagnitude;
/// \brief "physics:high"
///
/// UsdPhysicsLimitAPI
const TfToken physicsHigh;
/// \brief "physics:jointEnabled"
///
/// UsdPhysicsJoint
const TfToken physicsJointEnabled;
/// \brief "physics:kinematicEnabled"
///
/// UsdPhysicsRigidBodyAPI
const TfToken physicsKinematicEnabled;
/// \brief "physics:localPos0"
///
/// UsdPhysicsJoint
const TfToken physicsLocalPos0;
/// \brief "physics:localPos1"
///
/// UsdPhysicsJoint
const TfToken physicsLocalPos1;
/// \brief "physics:localRot0"
///
/// UsdPhysicsJoint
const TfToken physicsLocalRot0;
/// \brief "physics:localRot1"
///
/// UsdPhysicsJoint
const TfToken physicsLocalRot1;
/// \brief "physics:low"
///
/// UsdPhysicsLimitAPI
const TfToken physicsLow;
/// \brief "physics:lowerLimit"
///
/// UsdPhysicsPrismaticJoint, UsdPhysicsRevoluteJoint
const TfToken physicsLowerLimit;
/// \brief "physics:mass"
///
/// UsdPhysicsMassAPI
const TfToken physicsMass;
/// \brief "physics:maxDistance"
///
/// UsdPhysicsDistanceJoint
const TfToken physicsMaxDistance;
/// \brief "physics:maxForce"
///
/// UsdPhysicsDriveAPI
const TfToken physicsMaxForce;
/// \brief "physics:minDistance"
///
/// UsdPhysicsDistanceJoint
const TfToken physicsMinDistance;
/// \brief "physics:principalAxes"
///
/// UsdPhysicsMassAPI
const TfToken physicsPrincipalAxes;
/// \brief "physics:restitution"
///
/// UsdPhysicsMaterialAPI
const TfToken physicsRestitution;
/// \brief "physics:rigidBodyEnabled"
///
/// UsdPhysicsRigidBodyAPI
const TfToken physicsRigidBodyEnabled;
/// \brief "physics:simulationOwner"
///
/// UsdPhysicsCollisionAPI, UsdPhysicsRigidBodyAPI
const TfToken physicsSimulationOwner;
/// \brief "physics:startsAsleep"
///
/// UsdPhysicsRigidBodyAPI
const TfToken physicsStartsAsleep;
/// \brief "physics:staticFriction"
///
/// UsdPhysicsMaterialAPI
const TfToken physicsStaticFriction;
/// \brief "physics:stiffness"
///
/// UsdPhysicsDriveAPI
const TfToken physicsStiffness;
/// \brief "physics:targetPosition"
///
/// UsdPhysicsDriveAPI
const TfToken physicsTargetPosition;
/// \brief "physics:targetVelocity"
///
/// UsdPhysicsDriveAPI
const TfToken physicsTargetVelocity;
/// \brief "physics:type"
///
/// UsdPhysicsDriveAPI
const TfToken physicsType;
/// \brief "physics:upperLimit"
///
/// UsdPhysicsPrismaticJoint, UsdPhysicsRevoluteJoint
const TfToken physicsUpperLimit;
/// \brief "physics:velocity"
///
/// UsdPhysicsRigidBodyAPI
const TfToken physicsVelocity;
/// \brief "rotX"
///
/// This token represents the rotate around X axis degree of freedom used in Joint Limits and Drives.
const TfToken rotX;
/// \brief "rotY"
///
/// This token represents the rotate around Y axis degree of freedom used in Joint Limits and Drives.
const TfToken rotY;
/// \brief "rotZ"
///
/// This token represents the rotate around Z axis degree of freedom used in Joint Limits and Drives.
const TfToken rotZ;
/// \brief "transX"
///
/// This token represents the translate around X axis degree of freedom used in Joint Limits and Drives.
const TfToken transX;
/// \brief "transY"
///
/// This token represents the translate around Y axis degree of freedom used in Joint Limits and Drives.
const TfToken transY;
/// \brief "transZ"
///
/// This token represents the translate around Z axis degree of freedom used in Joint Limits and Drives.
const TfToken transZ;
/// \brief "X"
///
/// Possible value for UsdPhysicsSphericalJoint::GetAxisAttr(), Default value for UsdPhysicsSphericalJoint::GetAxisAttr(), Possible value for UsdPhysicsPrismaticJoint::GetAxisAttr(), Default value for UsdPhysicsPrismaticJoint::GetAxisAttr(), Possible value for UsdPhysicsRevoluteJoint::GetAxisAttr(), Default value for UsdPhysicsRevoluteJoint::GetAxisAttr()
const TfToken x;
/// \brief "Y"
///
/// Possible value for UsdPhysicsSphericalJoint::GetAxisAttr(), Possible value for UsdPhysicsPrismaticJoint::GetAxisAttr(), Possible value for UsdPhysicsRevoluteJoint::GetAxisAttr()
const TfToken y;
/// \brief "Z"
///
/// Possible value for UsdPhysicsSphericalJoint::GetAxisAttr(), Possible value for UsdPhysicsPrismaticJoint::GetAxisAttr(), Possible value for UsdPhysicsRevoluteJoint::GetAxisAttr()
const TfToken z;
/// A vector of all of the tokens listed above.
const std::vector<TfToken> allTokens;
};
/// \var UsdPhysicsTokens
///
/// A global variable with static, efficient \link TfToken TfTokens\endlink
/// for use in all public USD API. \sa UsdPhysicsTokensType
extern USDPHYSICS_API TfStaticData<UsdPhysicsTokensType> UsdPhysicsTokens;
PXR_NAMESPACE_CLOSE_SCOPE
#endif