谁可以给我Bind.in.Box.band in a box中文版版(一定要能用到的) ...

> User Tutorial-Accurate Hit Testing
Accurate hit testing with Cocos2d-x 3.0 integrated physics feature
Contributed By: xhcnb
Cocos2d-x 3.0 version has an integrated physics feature based on chipmunk. It's very easy to make accurate hit testing in our cocos2d-x game.
Source code at
How to run?
Clone source code, android copy cocos2d-x 3.0 version files under cocos2d, the project looks like:
open proj.ios_mac/PhysicsDemo.xcodeproj to build for ios or mac
run proj.android/build_native.py to build for android.
I have put prbuilt files under
prebuilt编译好的, please checkout and test.
Basic principle
There is an open source body editor
, with this free&powerful tool we can get
physicsbody polygons of an sprite. Then we import the polygons data into game and let the physics engine handle the rest thing.
All we need is to write an parse function which can load file exported by [box2d-editor] to cocos2d-x physics system.
Here we go.
1.create new project:
-p com.example.phy -l cpp -d ~/Documents PhysicsDemo
2.open the new project in xcode(I use xcode, chose your favorite IDE)
open ~/Documents/PhysicsDemo/proj.ios_mac/PhysicsDemo.xcodeproj
3.make an image for test, I have downloaded the cocos2d-x logo from
http://www.cocos2d-x.org/wiki/Logo_Resources_of_Cocos2d-x
name it as 2dx.png, add the image to project.
4.download box2d-editor
/p/box2d-editor/
get a jar file, open it.
Node: please use JRE6 to run it.
5.get the body data
open the editor, create one new project, name bodies.json and save under the project's Resource.
Don't forget addbodies.json to project.
Create new body definition, name it 2dx.
Use Auto-trace to get the image edge.
Save bodies.json
Next, we should write some code to import bodies.json.
6.modify our scene
Edit method HelloWorld::createScene to enable physics feature.
auto scene = Scene::createWithPhysics();
scene-&getPhysicsWorld()-&setDebugDrawMask(PhysicsWorld::DEBUGDRAW_ALL);
Add our sprite to the layer:
sp_2dx = Sprite::create(&2dx.png&);
sp_2dx-&setPosition(Point(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
MyBodyParser::getInstance()-&parseJsonFile(&bodies.json&);
auto _body = MyBodyParser::getInstance()-&bodyFormJson(sp_2dx, &2dx&);
if (_body != nullptr) {
_body-&setDynamic(false);
_body-&setCollisionBitmask(0x000000);
sp_2dx-&setPhysicsBody(_body);
this-&addChild(sp_2dx, 0);
MyBodyParser is the helper class to load bodies.json, use rapidjson.
You can check the detailes in source code, key function is MyBodyParser::bodyFormJson.
Then, add touchListener, this's simple and nothing interesting to waste words.
7.check whether our sprite is clicked
In function HelloWorld::nodeUnderTouch:
Node* HelloWorld::nodeUnderTouch(cocos2d::Touch *touch)
Node* node =
auto location = this-&convertTouchToNodeSpace(touch);
auto scene = Director::getInstance()-&getRunningScene();
auto arr = scene-&getPhysicsWorld()-&getShapes(location);
for (auto& obj : arr)
if ( obj-&getBody()-&getNode() == sp_2dx)
node = obj-&getBody()-&getNode();
If this function return nullptr, means you havn't touch inside the Sprite's physics body.
This's all the magic, Checkout the source code and read more.
Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.Band in box中文版使用教程-Band in box神奇宝盒 耳朵舞动的奇迹-软件应用视频-星火视频教程
&&&&&&&&&&&&&&&Band in box中文版使用教程
名称:Band in box中文版使用教程分类:软件应用主讲:&&&&TAG:&&&&&&&&时间: 13:00收藏:&&
Band in box中文版使用教程相关介绍
顾名思义BAND IN A BOX就是&盒子里乐的队&,但是这个盒子可不比一般的盒子,因为这是盒子有着神奇的力量,你只需要操纵这个盒子就好像拥有了许多优秀的自动伴奏乐手,他们都乖乖地听你的指挥而且尽职尽责,演奏音乐时绝对不会开小差!什么摇滚乐队、说唱乐队、民乐乐队都统统搞定,甚至交响乐队也不在话下!神奇吧,赶快动手试试吧! 在BIAB 10中最重要的几个概念是和弦、声部、乐器、风格,我们听到的音乐都是BIAB 10根据用户给出的相应条件作出的作曲、配器反应,因此掌握这几个概念的基本用法就成为踏入BIAB 10音乐殿堂的捷径! 和弦在BIAB 10中是音乐进行的基础,是旋律走向的依据,其重要性不容置疑。细心的朋友会发现屏幕下方最大范围内被和弦播放列表占据着,也就是所有地播放都会按照这里具体的和弦进行。设定和弦的方法十分简单,在具体的小节位置上点击鼠标右键,在出现的和弦窗口中直接输入和弦名称到CHORD里,然后选择UPDATE就可以了,这时用PREVIEW试听一下和弦的声音效果,如不满意还可以修改!但大多用户没有进行过专业和声训练,对和弦的乐理不是很清楚,这时就可以选择CHORD BUILDER,直观地用耳朵来确定和弦位置了!先选择和弦的根音,比如C和弦,然后再选择MAJ、MAJ 7、MAJ9大三和弦、七、九和弦等细类,每当你选择一个和弦之后,马上就能听到和弦的声音效果,真是太棒了!让耳朵来作决定,完全解除你不懂乐理的后顾之忧!
┆ 版权所有:星火视频教程网 | 苏ICP备号 | Email:Cisco UCS Manager GUI Configuration Guide, Release 2.0 - Configuring Network-Related Policies [Cisco UCS Manager] - Cisco
Cisco UCS Manager GUI Configuration Guide, Release 2.0
Book Contents
Book Contents
Introduction
System Configuration
Network Configuration
Storage Configuration
Server Configuration
System Management
System Monitoring
Download Options
Book Title
Cisco UCS Manager GUI Configuration Guide, Release 2.0
Chapter Title
Configuring Network-Related Policies
View with Adobe Reader on a variety of devices
View in various apps on iPhone, iPad, Android, Sony Reader, or Windows Phone
Chapter: Configuring Network-Related Policies
Chapter Contents
Configuring Network-Related Policies
This chapter includes the following sections:
Configuring vNIC Templates
vNIC Template
This policy defines how a vNIC on a server connects to the LAN. This policy is also referred to as a vNIC LAN connectivity policy.
Beginning in Cisco UCS, Release 2.0(2), Cisco UCS Manager does not automatically create a VM-FEX port profile with the correct settings when you create a vNIC template. If you want to create a VM-FEX port profile, you must configure the target of the vNIC template as a VM.
You need to include this policy in a service profile for it to take effect.
If your server has two Emulex or QLogic NICs (Cisco UCS CNA M71KR-E or Cisco UCS CNA M71KR-Q), you must configure vNIC policies for both adapters in your service profile to get a user-defined MAC address for both NICs. If you do not configure policies for both NICs, Windows still detects both of them in the PCI bus. Then because the second eth is not part of your service profile, Windows assigns it a hardware MAC address. If you then move the service profile to a different server, Windows sees additional NICs because one NIC did not have a user-defined MAC address.
Creating a vNIC Template
Before You Begin
This policy requires that one or more of the following resources already exist in the system:
Named VLAN
QoS policy
LAN pin group
Statistics threshold policy
In the Navigation pane, click the LAN tab.
On the LAN tab, expand LAN & Policies.
Expand the node for the organization where you want to create the policy.
If the system does not include multitenancy, expand the root node.
Right-click the vNIC Templates node and choose Create vNIC Template.
In the Create vNIC Template dialog box:
In the General area, complete the following fields:
Description
Do not enable vNIC fabric failover under the following circumstances:
If the Cisco UCS domain is running in Ethernet Switch Mode. vNIC fabric failover is not supported in that mode. If all Ethernet uplinks on one fabric interconnect fail, the vNICs do not fail over to the other.
if you plan to associate one or more vNICs created from this template with a server that has an adapter which does not support fabric failover, such as the Cisco UCS 82598KR-CI 10-Gigabit Ethernet Adapter. If you do so, Cisco UCS Manager generates a configuration fault when you associate the service profile with the server.
If the Cisco UCS domain is running in Ethernet Switch Mode. vNIC fabric failover is not supported in that mode. If all Ethernet uplinks on one fabric interconnect fail, the vNICs do not fail over to the other.
if you plan to associate this vNIC configuration with a server that has an adapter which does not support fabric failover, such as the Cisco UCS 82598KR-CI 10-Gigabit Ethernet Adapter. If you do so, Cisco UCS Manager generates a configuration fault when you associate the service profile with the server.
In the VLANs area, use the table to select the VLAN to assign to vNICs created from this template. The table contains the following columns:
Description
In the Policies area, complete the following fields:
Description
If the vNIC template has an associated QoS policy, the MTU specified here must be equal to or less than the MTU specified in the associated QoS system class. If this MTU value exceeds the MTU value in the QoS system class, packets may be dropped during data transmission.
What to Do Next
Include the vNIC template in a service profile.
Deleting a vNIC Template
In the Navigation pane, click the LAN tab.
On the LAN tab, expand LAN & Policies &
Organization_Name.
Expand the vNIC Templates node.
Right-click the policy you want to delete and choose Delete.
If the Cisco UCS Manager GUI displays a confirmation dialog box, click Yes.
Binding a vNIC to a vNIC Template
You can bind a vNIC associated with a service profile to a vNIC template. When you bind the vNIC to a vNIC template, Cisco UCS Manager configures the vNIC with the values defined in the vNIC template. If the existing vNIC configuration does not match the vNIC template, Cisco UCS Manager reconfigures the vNIC. You can only change the configuration of a bound vNIC through the associated vNIC template. You cannot bind a vNIC to a vNIC template if the service profile that includes the vNIC is already bound to a service profile template.
Important:
If the vNIC is reconfigured when you bind it to a template, Cisco UCS Manager reboots the server associated with the service profile.
In the Navigation pane, click the Servers tab.
On the Servers tab, expand Servers & Service Profiles.
Expand the node for the organization that includes the service profile with the vNIC you want to bind.
If the system does not include multi-tenancy, expand the root node.
Service_Profile_Name
Click the vNIC you want to bind to a template.
In the Work pane, click the General tab.
In the Actions area, click Bind to a Template.
In the Bind to a vNIC Template dialog box, do the following:
From the vNIC Template drop-down list, choose the template to which you want to bind the vNIC.
In the warning dialog box, click Yes to acknowledge that Cisco UCS Manager may need to reboot the server if the binding causes the vNIC to be reconfigured.
Unbinding a vNIC from a vNIC Template
In the Navigation pane, click the Servers tab.
On the Servers tab, expand Servers & Service Profiles.
Expand the node for the organization that includes the service profile with the vNIC you want to unbind.
If the system does not include multi-tenancy, expand the root node.
Service_Profile_Name
Click the vNIC you want to unbind from a template.
In the Work pane, click the General tab.
In the Actions area, click Unbind from a Template.
If the Cisco UCS Manager GUI displays a confirmation dialog box, click Yes.
Configuring Ethernet Adapter Policies
Ethernet and Fibre Channel Adapter Policies
These policies govern the host-side behavior of the adapter, including how the adapter handles traffic. For example, you can use these policies to change default settings for the following:
Interrupt handling
Performance enhancement
Failover in an cluster configuration with two fabric interconnects
For Fibre Channel adapter policies, the values displayed by Cisco UCS Manager may not match those displayed by applications such as QLogic SANsurfer. For example, the following values may result in an apparent mismatch between SANsurfer and Cisco UCS Manager:
Max LUNs Per Target--SANsurfer has a maximum of 256 LUNs and does not display more than that number. Cisco UCS Manager supports a higher maximum number of LUNs.
Link Down Timeout--In SANsurfer, you configure the timeout threshold for link down in seconds. In Cisco UCS Manager, you configure this value in milliseconds. Therefore, a value of 5500 ms in Cisco UCS Manager displays as 5s in SANsurfer.
Max Data Field Size--SANsurfer has allowed values of 512, 1024, and 2048. Cisco UCS Manager allows you to set values of any size. Therefore, a value of 900 in Cisco UCS Manager displays as 512 in SANsurfer.
Operating System Specific Adapter Policies
By default, Cisco UCS provides a set of Ethernet adapter policies and Fibre Channel adapter policies. These policies include the recommended settings for each supported server operating system. Operating systems are sensitive to the settings in these policies. Storage vendors typically require non-default adapter settings. You can find the details of these required settings on the support list provided by those vendors.
Important:
We recommend that you use the values in these policies for the applicable operating system. Do not modify any of the values in the default policies unless directed to do so by Cisco Technical Support.
However, if you are creating an Ethernet adapter policy for a Windows OS (instead of using the default Windows adapter policy), you must use the following formulas to calculate values that work with Windows:
Completion Queues = Transmit Queues + Receive Queues
Interrupt Count = (Completion Queues + 2) rounded up to nearest power of 2
For example, if Transmit Queues = 1 and Receive Queues = 8 then:
Completion Queues = 1 + 8 = 9
Interrupt Count = (9 + 2) rounded up to the nearest power of 2 = 16
Creating an Ethernet Adapter Policy
If the fields in an area are not displayed, click the Expand icon to the right of the heading.
In the Navigation pane, click the Servers tab.
On the Servers tab, expand Servers & Policies.
Expand the node for the organization where you want to create the policy.
If the system does not include multitenancy, expand the root node.
Right-click Adapter Policies and choose Create Ethernet Adapter Policy.
Enter a name and description for the policy in the following fields:
Description
(Optional)In the Resources area, adjust the following values:
Description
(Optional)In the Options area, adjust the following values:
Description
This option affects only packets sent from the interface.
This option affects only packets received by the interface.
This option is also known as Large Send Offload (LSO) and affects only packets sent from the interface.
This option affects only packets received by the interface.
If the Cisco UCS Manager GUI displays a confirmation dialog box, click Yes.
Deleting an Ethernet Adapter Policy
In the Navigation pane, click the LAN tab.
On the LAN tab, expand LAN & Policies &
Organization_Name.
Expand the Adapter Policies node.
Right-click the Ethernet adapter policy that you want to delete and choose Delete.
If the Cisco UCS Manager GUI displays a confirmation dialog box, click Yes.
Configuring Network Control Policies
Network Control Policy
This policy configures the network control settings for the Cisco UCS domain, including the following:
Whether the Cisco Discovery Protocol (CDP) is enabled or disabled
How the VIF behaves if no uplink port is available in end-host mode
The action that Cisco UCS Manager takes on the remote Ethernet interface, vEthernet interface , or vFibreChannel interface when the associated border port fails
Whether the server can use different MAC addresses when sending packets to the fabric interconnect
Whether MAC registration occurs on a per-VNIC basis or for all VLANs.
Action on Uplink Fail
By default, the Action on Uplink Fail property in the network control policy is configured with a value of link-down. For adapters such as the Cisco UCS M81KR Virtual Interface Card, this default behavior directs Cisco UCS Manager to bring the vEthernet or vFibreChannel interface down if the associated border port fails. For Cisco UCS systems using a non-VM-FEX capable converged network adapter that supports both Ethernet and FCoE traffic, such as Cisco UCS CNA M72KR-Q and the Cisco UCS CNA M72KR-E, this default behavior directs Cisco UCS Manager to bring the remote Ethernet interface down if the associated border port fails. In this scenario, any vFibreChannel interfaces that are bound to the remote Ethernet interface are brought down as well.
Cisco UCS Manager, release 1.4(2) and earlier did not enforce the Action on Uplink Fail property for those types of non-VM-FEX capable converged network adapters mentioned above. If the Action on Uplink Fail property was set to link-down, Cisco UCS Manager would ignore this setting and instead issue a warning. In the current version of Cisco UCS Manager this setting is enforced. Therefore, if your implementation includes one of those converged network adapters and the adapter is expected to handle both Ethernet and FCoE traffic, we recommend that you configure the Action on Uplink Fail property with a value of warning.
Please note that this configuration may result in an Ethernet teaming driver not being able to detect a link failure when the border port goes down.
MAC Registration Mode
In Cisco UCS Manager, releases 1.4 and earlier, MAC addresses were installed on all of the VLANs belonging to an interface. Starting in release 2.0, MAC addresses are installed only on the native VLAN by default. In most implementations this maximizes the VLAN port count.
If a trunking driver is being run on the host and the interface is in promiscuous mode, we recommend that you set the Mac Registration Mode to All VLANs.
Creating a Network Control Policy
MAC address-based port security for Emulex converged Network Adapters (N20-AE0102) is not supported. When MAC address-based port security is enabled, the fabric interconnect restricts traffic to packets that contain the MAC address that it first learns. This is either the source MAC address used in the FCoE Initialization Protocol packet, or the MAC address in an ethernet packet, whichever is sent first by the adaptor. This configuration can result in either FCoE or Ethernet packets being dropped.
In the Navigation pane, click the LAN tab.
On the LAN tab, expand LAN & Policies.
Expand the node for the organization where you want to create the policy.
If the system does not include multitenancy, expand the root node.
Right-click the Network Control Policies node and select Create Network Control Policy.
In the Create Network Control Policy dialog box, complete the following fields:
Description
Cisco UCS Manager, release 1.4(2) and earlier did not enforce the Action on Uplink Fail property for those types of non-VM-FEX capable converged network adapters mentioned above. If the Action on Uplink Fail property was set to link-down, Cisco UCS Manager would ignore this setting and instead issue a warning. In the current version of Cisco UCS Manager this setting is enforced. Therefore, if your implementation includes one of those converged network adapters and the adapter is expected to handle both Ethernet and FCoE traffic, we recommend that you configure the Action on Uplink Fail property with a value of warning.
Please note that this configuration may result in an Ethernet teaming driver not being able to detect a link failure when the border port goes down.
In the MAC Security area, do the following to determine whether the server can use different MAC addresses when sending packets to the fabric interconnect:
Click the Expand icon to expand the area and display the radio buttons.
Click one of the following radio buttons to determine whether forged MAC addresses are allowed or denied when packets are sent from the server to the fabric interconnect:
Allow-- All server packets are accepted by the fabric interconnect, regardless of the MAC address associated with the packets.
Deny-- After the first packet has been sent to the fabric interconnect, all other packets must use the same MAC address or they will be silently rejected by the fabric interconnect. In effect, this option enables port security for the associated vNIC.
If you plan to install VMware ESX on the associated server, you must configure the MAC Security to allow for the network control policy applied to the default vNIC. If you do not configure MAC Security for allow, the ESX installation may fail because the MAC security permits only one MAC address while the installation process requires more than one MAC address.
Deleting a Network Control Policy
In the Navigation pane, click the LAN tab.
On the LAN tab, expand LAN & Policies &
Organization_Name.
Expand the Network Control Policies node.
Right-click the policy you want to delete and select Delete.
If the Cisco UCS Manager GUI displays a confirmation dialog box, click Yes.
Was this Document Helpful?
Let Us Help
(Requires a )
Related Support Community Discussions

参考资料

 

随机推荐