圆柱的自动旋转

本文介绍如何在3D环境中实现圆柱体的自动旋转,通过编程技术详细阐述了从.h到.cpp文件的实现过程。
摘要由CSDN通过智能技术生成

.h文件的内容如下:

#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__

#include "cocos2d.h"

class HelloWorld : public cocos2d::Layer
{
public:
    // there's no 'id' in cpp, so we recommend returning the class instance pointer
    static cocos2d::Scene* createScene();

    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
    virtual bool init();

    // implement the "static create()" method manually

	void cylinderUpdate(float dt);

	float _cylinder_texture_offset;
	float _shining_duraion;
	cocos2d::GLProgramState * _state;

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
	cocos2d::EventListenerCustom* _backToForegroundListener;
#endif
    CREATE_FUNC(HelloWorld);
};

#endif // __HELLOWORLD_SCENE_H__


.cpp的文件内容如下:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值