Describes a system of graphs to define nonlinear responses to PhysxVehicleControllerAPI command values like accelerator, brake0, brake1 and steer. More...
Inherits UsdAPISchemaBase.
Public Member Functions | |
PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI (const UsdPrim &prim=UsdPrim(), const TfToken &name=TfToken()) | |
Construct a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI on UsdPrim prim with name name . More... | |
PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI (const UsdSchemaBase &schemaObj, const TfToken &name) | |
Construct a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI on the prim held by schemaObj with name name . More... | |
virtual PHYSXSCHEMA_API | ~PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI () |
Destructor. More... | |
TfToken | GetName () const |
Returns the name of this multiple-apply schema instance. More... | |
PHYSXSCHEMA_API UsdAttribute | GetCommandValuesAttr () const |
The command values to define response graphs for. More... | |
PHYSXSCHEMA_API UsdAttribute | CreateCommandValuesAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetCommandValuesAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. More... | |
PHYSXSCHEMA_API UsdAttribute | GetSpeedResponsesPerCommandValueAttr () const |
List of indices pointing to the start of a response graph for a certain command value. More... | |
PHYSXSCHEMA_API UsdAttribute | CreateSpeedResponsesPerCommandValueAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetSpeedResponsesPerCommandValueAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. More... | |
PHYSXSCHEMA_API UsdAttribute | GetSpeedResponsesAttr () const |
List of pairs that define points in graphs of longitudinal speed vs. More... | |
PHYSXSCHEMA_API UsdAttribute | CreateSpeedResponsesAttr (VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const |
See GetSpeedResponsesAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create. More... | |
Static Public Member Functions | |
static PHYSXSCHEMA_API const TfTokenVector & | GetSchemaAttributeNames (bool includeInherited=true) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes. More... | |
static PHYSXSCHEMA_API TfTokenVector | GetSchemaAttributeNames (bool includeInherited, const TfToken &instanceName) |
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor classes for a given instance name. More... | |
static PHYSXSCHEMA_API PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI | Get (const UsdStagePtr &stage, const SdfPath &path) |
Return a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI holding the prim adhering to this schema at path on stage . More... | |
static PHYSXSCHEMA_API PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI | Get (const UsdPrim &prim, const TfToken &name) |
Return a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI with name name holding the prim prim . More... | |
static PHYSXSCHEMA_API std::vector < PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI > | GetAll (const UsdPrim &prim) |
Return a vector of all named instances of PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI on the given prim . More... | |
static PHYSXSCHEMA_API bool | IsSchemaPropertyBaseName (const TfToken &baseName) |
Checks if the given name baseName is the base name of a property of PhysxVehicleNonlinearCommandResponseAPI. More... | |
static PHYSXSCHEMA_API bool | IsPhysxVehicleNonlinearCommandResponseAPIPath (const SdfPath &path, TfToken *name) |
Checks if the given path path is of an API schema of type PhysxVehicleNonlinearCommandResponseAPI. More... | |
static PHYSXSCHEMA_API bool | CanApply (const UsdPrim &prim, const TfToken &name, std::string *whyNot=nullptr) |
Returns true if this multiple-apply API schema can be applied, with the given instance name, name , to the given prim . More... | |
static PHYSXSCHEMA_API PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI | Apply (const UsdPrim &prim, const TfToken &name) |
Applies this multiple-apply API schema to the given prim along with the given instance name, name . More... | |
Static Public Attributes | |
static const UsdSchemaKind | schemaKind = UsdSchemaKind::MultipleApplyAPI |
Compile time constant representing what kind of schema this class is. More... | |
Protected Member Functions | |
PHYSXSCHEMA_API UsdSchemaKind | _GetSchemaKind () const override |
Returns the kind of schema this class belongs to. More... | |
Friends | |
class | UsdSchemaRegistry |
Describes a system of graphs to define nonlinear responses to PhysxVehicleControllerAPI command values like accelerator, brake0, brake1 and steer.
The normalized response will be a function of the command value and the longitudinal vehicle speed. The response will be computed by interpolating between the points of the graph and then interpolating those results again between the closest graphs. One example usage of nonlinear command response is a brake pedal that has an almost flat response when tipped slightly but a very strong response from a certain point on. Another example is the steering wheel showing a strong response for a large input at low speed but only a weak response at high speed.
This multipleApply schema can be used to control the response to steering (use instance name TfToken "steer") and braking (use instance name TfTokens "brakes0" or "brakes1"). It can also control the response to the accelerator but only in combination with the basic drive (use instance name TfToken "drive"). Furthermore, this API has to be applied to the appropriate prims to take effect: "steer" has to be applied to a prim that has PhysxVehicleSteeringAPI or PhysxVehicleAckermannSteeringAPI applied. "brakes0"/"brakes1" have to be applied to a prim that has PhysxVehicleBrakesAPI:brakes0/brakes1 applied. "drive" has to be applied to a prim that has PhysxVehicleDriveBasicAPI applied.
Definition at line 73 of file physxVehicleNonlinearCommandResponseAPI.h.
|
inlineexplicit |
Construct a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI on UsdPrim prim
with name name
.
Equivalent to PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI::Get( prim.GetStage(), prim.GetPath().AppendProperty( "physxVehicleNCR:name"));
for a valid prim
, but will not immediately throw an error for an invalid prim
Definition at line 90 of file physxVehicleNonlinearCommandResponseAPI.h.
|
inlineexplicit |
Construct a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI on the prim held by schemaObj
with name name
.
Should be preferred over PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI(schemaObj.GetPrim(), name), as it preserves SchemaBase state.
Definition at line 99 of file physxVehicleNonlinearCommandResponseAPI.h.
|
virtual |
Destructor.
|
overrideprotected |
Returns the kind of schema this class belongs to.
|
static |
Applies this multiple-apply API schema to the given prim
along with the given instance name, name
.
This information is stored by adding "PhysxVehicleNonlinearCommandResponseAPI:<i>name</i>" to the token-valued, listOp metadata apiSchemas on the prim. For example, if name
is 'instance1', the token 'PhysxVehicleNonlinearCommandResponseAPI:instance1' is added to 'apiSchemas'.
|
static |
Returns true if this multiple-apply API schema can be applied, with the given instance name, name
, to the given prim
.
If this schema can not be a applied the prim, this returns false and, if provided, populates 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.
PHYSXSCHEMA_API UsdAttribute CreateCommandValuesAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetCommandValuesAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create.
If specified, author defaultValue
as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely
is true
- the default for writeSparsely
is false
.
PHYSXSCHEMA_API UsdAttribute CreateSpeedResponsesAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetSpeedResponsesAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create.
If specified, author defaultValue
as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely
is true
- the default for writeSparsely
is false
.
PHYSXSCHEMA_API UsdAttribute CreateSpeedResponsesPerCommandValueAttr | ( | VtValue const & | defaultValue = VtValue() , |
bool | writeSparsely = false |
||
) | const |
See GetSpeedResponsesPerCommandValueAttr(), and also Usd_Create_Or_Get_Property for when to use Get vs Create.
If specified, author defaultValue
as the attribute's default, sparsely (when it makes sense to do so) if writeSparsely
is true
- the default for writeSparsely
is false
.
|
static |
Return a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI holding the prim adhering to this schema at path
on stage
.
If no prim exists at path
on stage
, or if the prim at that path does not adhere to this schema, return an invalid schema object. path
must be of the format <path>.physxVehicleNCR:name .
This is shorthand for the following:
|
static |
Return a PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI with name name
holding the prim prim
.
Shorthand for PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI(prim, name);
|
static |
Return a vector of all named instances of PhysxSchemaPhysxVehicleNonlinearCommandResponseAPI on the given prim
.
PHYSXSCHEMA_API UsdAttribute GetCommandValuesAttr | ( | ) | const |
The command values to define response graphs for.
Each listed command value (in range [0, 1], steer commands are treated symmetrically) has to point to a graph in speedResponses. The command values refer to steer, brake0 etc. The values have to be strictly increasing. The number of entries has to match the number of entries in speedResponsesPerCommandValue and is limited to 8. Every command value needs at least one entry in speedResponses.
Declaration | float[] commandValues |
C++ Type | VtArray<float> |
Usd Type | SdfValueTypeNames->FloatArray |
|
inline |
Returns the name of this multiple-apply schema instance.
Definition at line 125 of file physxVehicleNonlinearCommandResponseAPI.h.
|
static |
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.
|
static |
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.
PHYSXSCHEMA_API UsdAttribute GetSpeedResponsesAttr | ( | ) | const |
List of pairs that define points in graphs of longitudinal speed vs.
normalized response. The first value of the pair is the longitudinal speed, the second value is the expected response (in range [0, 1]). The longitudinal speed values within a graph have to be strictly increasing. The maximum allowed number of entries is 64. See speedResponsesPerCommandValue for how the different graphs are accessed.
Declaration | float2[] speedResponses |
C++ Type | VtArray<GfVec2f> |
Usd Type | SdfValueTypeNames->Float2Array |
PHYSXSCHEMA_API UsdAttribute GetSpeedResponsesPerCommandValueAttr | ( | ) | const |
List of indices pointing to the start of a response graph for a certain command value.
The index values have to be strictly increasing. The graph for command value commandValues[i] starts at entry speedResponses[speedResponsesPerCommandValue[i]] and stops at entry speedResponses[speedResponsesPerCommandValue[i+1] - 1]. The number of entries has to match the number of entries in commandValues and has the same maximum limit.
Declaration | int[] speedResponsesPerCommandValue |
C++ Type | VtArray<int> |
Usd Type | SdfValueTypeNames->IntArray |
|
static |
Checks if the given path path
is of an API schema of type PhysxVehicleNonlinearCommandResponseAPI.
If so, it stores the instance name of the schema in name
and returns true. Otherwise, it returns false.
|
static |
Checks if the given name baseName
is the base name of a property of PhysxVehicleNonlinearCommandResponseAPI.
|
static |
Compile time constant representing what kind of schema this class is.
Definition at line 79 of file physxVehicleNonlinearCommandResponseAPI.h.