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
파일 보기 프로젝트 열기: jpwchang/VirtualVEX

공개 프로퍼티들

프로퍼티 타입 설명
skin UnityEngine.GUISkin
timer GameObject

보호된 프로퍼티들

프로퍼티 타입 설명
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