physics/CCColliderDetector

#ifndef __CCCOLLIDERDETECTOR_H__

#define __CCCOLLIDERDETECTOR_H__


#include "../utils/CCArmatureDefine.h"

#include "../datas/CCDatas.h"


class b2Body;

struct b2Filter;


NS_CC_EXT_BEGIN


class CCBone;


class ColliderBody : public CCObject

{

public:

ColliderBody(b2Body *b2b, CCContourData *contourData)

:m_pB2b(NULL)

,m_pContourData(NULL)

{

this->m_pB2b = b2b;

this->m_pContourData = contourData;

CC_SAFE_RETAIN(m_pContourData);

}


~ColliderBody()

{

CC_SAFE_RELEASE(m_pContourData);

}


inline b2Body *getB2Body()

{

return m_pB2b;

}


inline CCContourData *getContourData()

{

return m_pContourData;

}


private:

b2Body *m_pB2b;

CCContourData *m_pContourData;

};


/*

 *  @brief  ContourSprite used to draw the contour of the display

 */

class CCColliderDetector : public CCObject

{

public:

static CCColliderDetector *create();

    static CCColliderDetector *create(CCBone *bone);

public:

CCColliderDetector();

~CCColliderDetector(void);

    

    virtual bool init();

virtual bool init(CCBone *bone);

    

    void addContourData(CCContourData *contourData);

    void addContourDataList(CCArray *contourDataList);

    

void removeContourData(CCContourData *contourData);

void removeAll();

    

    void updateTransform(CCAffineTransform &t);


void setColliderFilter(b2Filter &filter);


    void setActive(bool active);

private:

    CCArray *m_pColliderBodyList;

    

CC_SYNTHESIZE(CCBone*, m_pBone, Bone);


};

NS_CC_EXT_END


#endif /*__CCCOLLIDERDETECTOR_H__*/


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Vehicle physics package suitable for wide range of vehicles. Realistic, easy to use and heavily customizable. Wheel Controller 3D, a custom in-house wheel solution, has been used for wheel physics while the rest of the system had been written from the ground up. General features: • Fast vehicle setup with quick start video or included manual. • Seven vehicle prefabs of different types are included: sports car, sedan, 8x8 truck, monster truck, tank, city bus and semi with trailer. • Suitable for wide range of applications. • Runs on both desktop and mobile devices. • Uses custom in-house wheel solution – Wheel Controller 3D – for 3D ground detection and high level of customizability. • Per-wheel surface detection based on terrain textures or object tags. Different friction curves and effects for each surface. • Suspend option for inactive vehicles which minimizes impact on performance while keeping basic functionality. • Character vehicle changer that works with any character controller / game object, including other vehicles. • Helper scripts such as analog and digital gauge controllers, camera and vehicle changers, center of mass and downforce adjusters, etc. Vehicle Physics Details: Engine • Realistic engine power and torque calculation with adjustable power curve and RPM range. • Functional forced induction. Transmission • Gear ratios and final gear ratio. • Dynamic shift point based on load. • Three transmission types: Automatic, Automatic Sequential and Manual. • Manual transmission supports both sequential and H-pattern shifting. • Center differential: Open, Limited Slip, Locking or Equal. Axles • Geometry settings for each axle: Steering Angle, Pro/Anti Ackermann Steering, Toe, Camber, Caster and Anti-roll Bar. • Adjustable power, braking and handbrake distribution. • Per-axle differentials: Open, Limited Slip, Locking and Equal. • Supports solid axle (check Monster Truck in the demo). Damage • Optimized queue-based mesh deformation that spreads processing over multiple frames. • Damage influences vehicle performance and handling. Audio • All audio sources are set up automatically. • Sound can be adjusted through Audio Mixer for all vehicles or though inbuilt mixer for each vehicle and each effect individually. • Engine, forced induction, gear change, suspension, surface, skid, crash, air brake, horn and blinker sounds. Effects • Vehicle light system with low beam, high beam, stop and brake lights, blinkers. • Can be used with any number of lights of any type and/or emissive materials. • Persistent and well optimized mesh-based skidmarks. • Exhaust particle effects based on engine state. • Per-wheel dust and smoke particle effects based on surface the wheel is on. Input • Desktop input using standard input manager with mouse steering option. • Mobile input through on-screen steering wheel and pedals or tilt controls. Trailer • Trailer is a vehicle in itself meaning all the effects that work on a vehicle work on a trailer too. • Trailer gets input routed from the vehicle it is attached to which results in functional lights, braking, damage and even steering if needed. • Built-in attach / detach functionality where any vehicle can attach any trailer with correct tag. Fuel • Fuel consumption calculation using engine’s efficiency. • Readouts in l/100km, km/l and US mpg. UI • Universal analog and digital gauge controllers and lights for use in dashboard or HUD. Code • Modular code structure for easy modification and upgrading. • C# source code with XML comments on all public members. • Tooltip explanations for all visible variables. Compatible With Complete Terrain Shader and IK Driver Vehicle Controller European Truck and Trailer and Super Car models provided by GAME READY 3D MODELS . Try it out: Windows 64bit MacOS X 64bit Android (mobile scene) More info: Website Unity Forums YouTube Class Reference Changelog Note: Wheel Controller 3D is included with this asset and its price has been factored in. If you already own WC3D check the upgrade options. If you have any questions. problems or suggestions you can contact us at nwhcoding@gmail.com. Support is free and we always answer within a few hours.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值