Property+Methods

//Setter// is a specialized term used to describe a procedure that changes the value of an object’s property. //Getterc//is a specialized term used to describe a function that returns the current value of an object’s property. Currently in Alice 3, most setters and getters can be found in the Procedures and Functions tabs of the Methods Panel. (For example, //setVehiclec//is in the Procedures tab, and //getWidth// is in the Functions tab.)
 * PROPERTY METHODS**

The Methods panel has three tabs so as to distinguish between // procedural // methods, // functional // methods, and methods related to that object's specific // properties. // This figure illustrates the three tabs in a side-by-side listing, using // penny // (an instance of ** Penguin ** ) as an example.

**Side-by-side listing of built-in procedural, functional, and property methods**

****Important concepts:**** Some properties, however, are general purpose in that they are defined for the purpose of rendering an object in the scene. Getters and setters for these properties are conveniently listed in the Properties tab of the Methods panel. For example, the alien’s setters and getters are shown in this figure and summarized in the table.
 * //Procedural methods// describe actions that may be performed by an object, such as move, turn, or roll. These actions often change the location and/or orientation of an object. The important thing to know about procedural methods is that they each perform an action but do not compute and return an answer to a question.
 * //Functional methods// are expressions that compute and answer a question about an object such as what is its width or height, or what is its distance from another object.
 * //Properties methods are//methods for retrieving (get) and changing (set) specific properties of an object of this class. These specific properties, such as paint, opacity, name, and vehicle, are used in animation rendering.



**Getters and setters for specialized properties**

**Setters and Getters for specialized properties**
 * **Procedure** || **Argument(s)**  ||  **Description**  ||
 * **setPaint** || //paint//  || Sets the paint value of//this//object to the//paint//argument ||
 * **setOpacity** || //opacity//  || Used to set the transparency of//this//object by setting the opacity value of//this//object using a range of values from**0.0**(invisible) to**1.0**(fully opaque). ||
 * **setName** || //name//  || NOTE: THIS DOES NOT CHANGE THE IDENTIFIER NAME OF THIS OBJECT IN PROGRAM CODE, but does change the internal identifier used by Alice for debugging purposes. ||


 * **Function** || **Return type**  ||  **Description**  ||
 * **getPaint** || //paint//  || Returns the paint value of//this//object ||
 * **getOpacity** || //DecimalNumber//  || Returns the opacity value in the range of**0.0**(invisible) to**1.0**(fully opaque).of//this//object ||
 * **getName** || //TextString//  || NOTE: THIS DOES NOT RETURN THE IDENTIFIER NAME OF THIS OBJECT IN PROGRAM CODE, but the internal identifier used by Alice in the virtual machine. ||
 * **getVehicle** || //Model//  || Returns a link to another object in the scene that is serving as the vehicle for//this//object ||

**Methods that can be called on an object’s internal joints**

//Procedures//
Almost all 3D model classes in the Gallery have a system of internal joints. The joints can be thought of as the pivot points of //sub-parts// of the object and can be used in the Scene editor to position sub-parts during scene setup. An object's joints are also objects, and program statements can be written to animate an object’s sub-parts by rotating and orienting an object's internal joints. Procedures that can be used to animate joints are shown.



**Procedural methods for an object's internal joints**

These procedures perform the same actions that were described for the entire object, but the pivot point is at the joint. For example, a statement can be created to tell the alien to turn its //right shoulder joint backward//, as shown. As the right shoulder joint turns, the right upper arm, lower arm, and hand also turn. That is, the arm parts are attached to the body through the shoulder joint. For this reason, the arms parts turn when the joint turns.



**A statement to turn the alien's right shoulder joint**

Notice that the procedures in Figure A.15 do not include methods that //move//the joint. In Alice 3, a joint cannot be moved out of its normal position within the skeletal structure of the object’s body. In other words, a joint and its attached sub-part(s) cannot be separated from the body. The only unique procedure for joints is //setPivotVisible//, as described in this table.

**Procedure specific to internal joints**
 * **Procedure** || **Argument(s)**  ||  **Description**  ||
 * **setPivotVisible** || **true**or**false**  || Displays the pivot position and orientation of//this//joint in the animation if the argument is true, hides the pivot position and orientation of//this//joint in the animation if the argument is false ||

//Functions//  Almost all functional methods for an entire object are functions that access (return a link to) one of the joints belonging to that object. However, there are only a few functions that can be called on an individual joint, as shown.



**Functional methods for a joint**

The available functional methods have the same name and perform the same actions as the functions of the same name for the entire object. Refer back to Table A.7 for the descriptions of these methods. The only function that is unique to joints is the //isPivotVisible//function, as summarized below.

**A unique function for internal joints**
 * **Function** || **Return Type**  ||  **Description**  ||
 * **isPivotVisible** || //Boolean//  || Returns**true**if the pivot position and orientation of//this//joint in the animation is being displayed, or else returns**false**if the pivot position and orientation of//this//joint in the animation is not being displayed ||

//Properties//  All of the available getters and setters on the Properties tab/Methods panel of an object’s internal joints are the same as the getters and setters of the same name for the entire object, as shown. Refer to the table for descriptions of these specialized methods.



**Properties methods for internal joints**