随笔 - 3, 文章 - 1, 评论 - 2, 引用 - 0
数据加载中……

2010年3月13日

给GO添加弹性.

1         PhysicMaterial physicMaterial = new PhysicMaterial();
2         physicMaterial.bouncyness = 1;
3         collider.material = physicMaterial;

首先在GO上绑定一个Rigidbody,再添加如上代码!

posted @ 2010-03-13 22:48 uloaix 阅读(170) | 评论 (0)编辑 收藏

2008年12月15日

隐含了的this

 1 public class CalC
 2 {
 3     void amethod()
 4     {
 5         System.out.println("CalC.amethod");
 6     }
 7     
 8     CalC()
 9     {
10         amethod();
11         System.out.println("Hu?");
12     }
13      
14     /**
15     *   @param args
16     */
17     public static void main(String[] args)
18     {
19         CalC cc = new CalChild();
20         cc.amethod();
21     }
22 }
23 
24 class CalChild extends CalC
25 {
26     void amethod()
27     {
28         System.out.println("CalChild.amethod");
29     }
30 }

输出的结果是:
CalChild.amethod
Hu?
CalChild.amethod

调用java中的所有成员变量/成员函数都隐含了this.
方法在内存中只有一个备份,所有的对象都共享这个备份,为了区分开到底是哪个对象在调用这个方法,关键的地方就是this的使用.this把调用方法的上下文对应到当前对象上.


posted @ 2008-12-15 00:06 uloaix 阅读(1394) | 评论 (0)编辑 收藏

2008年11月27日

getWorldPosition从Ogre1.6的Renderable类中移除

     摘要:   阅读全文

posted @ 2008-11-27 22:02 uloaix 阅读(765) | 评论 (0)编辑 收藏