C# Класс vvRobotBase, VirtualVEX

Base class for all robots in VirtualVEX. vvRobotBase handles the loading of user code from a precompiled DLL file. This loaded code is used in the control of all inherited classes. Other functions common to all robots are also implemented in this base class. These include a timer function that keeps track of the current time and, if applicable, stops the robot at the time limit. The Physics Window and User Code window are also implemented here. vvRobotBase also contains definitions for the VirtualVEX developer API functions. These functions allow developers to easily configure their own robots.
Наследование: MonoBehaviour
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
skin UnityEngine.GUISkin
timer GameObject

Защищенные свойства (Protected)

Свойство Тип Описание
ErrorString_ string
SensorValue float[]
WWW_ WWW
assemblyURL_ string
complete_ bool
lMotorPowerPrev_ float
motor float[]
owner Field,
rMotorPowerPrev_ float
retried_ bool
robotID_ string
text_ string
tracker_ GameObject

Открытые методы

Метод Описание
OnGUI ( ) : void
ReloadAssembly ( string url ) : void
Start ( ) : void
Update ( ) : void
physWinFunc ( int windowId ) : void
setMotor ( GameObject motor, float powerLevel, MovementMode applyMode = MovementMode.DIRECT_VERTICAL ) : void

Assign a given power level to a motor on the virtual robot. This allows components of your robot other than the drivebase to move. This method is designed for moving parts that do not have an actual simulated motor. One example of such a part is a linear slider. This method simulates motor power by directly adding a force to the given component, or GameObject. As a result, you must specify a movement type. This tells the program what direction the component will be moving in and whether the motion is linear or rotational. There are 3 available movement types for linear motion:

LINEAR_VERTICAL: Straight up and down.

LINEAR_HORIZONTAL: Straight forward and backward.

LINEAR_SIDEWAYS: Straight left and right.

For compatibility reasons, this method also enables angular motion for arms. However, this method of angular motion is obsolete and the hinge joint version of setMotor should be used instead. For compatibility, the following angulat movement types are allowed:

DIRECT_VERTICAL: Rotational, up and down, facing forward (or backward). Perfect for arms.

DIRECT_HORIZONTAL: Rotational, side to side. Perfect for claws.

DIRECT_SIDEWAYS: Rotational, up and down, facing left or right.

All directions are relative to the robot. The default direction is DIRECT_VERTICAL.

setMotor ( GameObject motor, float velocity, float powerLevel ) : void

Assign a given power level to a motor on the virtual robot. This allows components of your robot other than the drivebase to move. This version of setMotor is designed for parts that rotate, such as arms and claws. The part must have a HingeJoint component (representing the motor axle) for this method to work. The orientation of the HingeJoint automatically determines the axis of rotation.

setMotor ( WheelCollider motor, float powerLevel ) : void

Assign a given power level to a wheel. This allows you to move the robot's drive base. A common use for this method is in driver control, passing in a joystick axis as the power level. This method can only be used on wheel colliders (usually found on drivebases). For a version that applies to other motor placements, see the overloaded version: setMotor(GameObject, float, int).

setMotors ( WheelCollider motor1, WheelCollider motor2, float powerLevel ) : void

Set two drive motors to the same power level. Useful for 4-wheel drivebases.

Защищенные методы

Метод Описание
LoadAssembly ( ) : Assembly

Приватные методы

Метод Описание
updateSensors ( float step ) : void

Описание методов

LoadAssembly() защищенный Метод

protected LoadAssembly ( ) : Assembly
Результат Assembly

OnGUI() публичный Метод

public OnGUI ( ) : void
Результат void

ReloadAssembly() публичный Метод

public ReloadAssembly ( string url ) : void
url string
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

Update() публичный Метод

public Update ( ) : void
Результат void

physWinFunc() публичный Метод

public physWinFunc ( int windowId ) : void
windowId int
Результат void

setMotor() публичный Метод

Assign a given power level to a motor on the virtual robot. This allows components of your robot other than the drivebase to move. This method is designed for moving parts that do not have an actual simulated motor. One example of such a part is a linear slider. This method simulates motor power by directly adding a force to the given component, or GameObject. As a result, you must specify a movement type. This tells the program what direction the component will be moving in and whether the motion is linear or rotational. There are 3 available movement types for linear motion:

LINEAR_VERTICAL: Straight up and down.

LINEAR_HORIZONTAL: Straight forward and backward.

LINEAR_SIDEWAYS: Straight left and right.

For compatibility reasons, this method also enables angular motion for arms. However, this method of angular motion is obsolete and the hinge joint version of setMotor should be used instead. For compatibility, the following angulat movement types are allowed:

DIRECT_VERTICAL: Rotational, up and down, facing forward (or backward). Perfect for arms.

DIRECT_HORIZONTAL: Rotational, side to side. Perfect for claws.

DIRECT_SIDEWAYS: Rotational, up and down, facing left or right.

All directions are relative to the robot. The default direction is DIRECT_VERTICAL.
public setMotor ( GameObject motor, float powerLevel, MovementMode applyMode = MovementMode.DIRECT_VERTICAL ) : void
motor GameObject Which motor to apply this to
powerLevel float The power to supply to this motor
applyMode MovementMode The direction this power should be applied in
Результат void

setMotor() публичный Метод

Assign a given power level to a motor on the virtual robot. This allows components of your robot other than the drivebase to move. This version of setMotor is designed for parts that rotate, such as arms and claws. The part must have a HingeJoint component (representing the motor axle) for this method to work. The orientation of the HingeJoint automatically determines the axis of rotation.
public setMotor ( GameObject motor, float velocity, float powerLevel ) : void
motor GameObject Which motor to apply this to
velocity float The motor's target velocity
powerLevel float How much power the motor gets
Результат void

setMotor() публичный Метод

Assign a given power level to a wheel. This allows you to move the robot's drive base. A common use for this method is in driver control, passing in a joystick axis as the power level. This method can only be used on wheel colliders (usually found on drivebases). For a version that applies to other motor placements, see the overloaded version: setMotor(GameObject, float, int).
public setMotor ( WheelCollider motor, float powerLevel ) : void
motor WheelCollider Which motor to apply this to
powerLevel float The power to supply to this motor
Результат void

setMotors() публичный Метод

Set two drive motors to the same power level. Useful for 4-wheel drivebases.
public setMotors ( WheelCollider motor1, WheelCollider motor2, float powerLevel ) : void
motor1 WheelCollider The first affected motor
motor2 WheelCollider The second affected motor
powerLevel float The power to supply to both motors
Результат void

Описание свойств

ErrorString_ защищенное свойство

protected string ErrorString_
Результат string

SensorValue защищенное свойство

protected float[] SensorValue
Результат float[]

WWW_ защищенное свойство

protected WWW WWW_
Результат WWW

assemblyURL_ защищенное свойство

protected string assemblyURL_
Результат string

complete_ защищенное свойство

protected bool complete_
Результат bool

lMotorPowerPrev_ защищенное свойство

protected float lMotorPowerPrev_
Результат float

motor защищенное свойство

protected float[] motor
Результат float[]

owner защищенное свойство

protected Field, owner
Результат Field,

rMotorPowerPrev_ защищенное свойство

protected float rMotorPowerPrev_
Результат float

retried_ защищенное свойство

protected bool retried_
Результат bool

robotID_ защищенное свойство

protected string robotID_
Результат string

skin публичное свойство

public GUISkin,UnityEngine skin
Результат UnityEngine.GUISkin

text_ защищенное свойство

protected string text_
Результат string

timer публичное свойство

public GameObject timer
Результат GameObject

tracker_ защищенное свойство

protected GameObject tracker_
Результат GameObject